How do you talk to Hamas?You really can't compare the two situations all though people love to, Hams is a territorial based Resistance Movement (not matter how abohrant some of their ideas are) Al Qaeda was or is a loose collection of misfits who just wanted to destroy the west their first goal was to remove American Soldiers from Saudi that achieved they just embarked on general nihilism
You can't make peace if you don't talk to your enemies and sometimes we will have a visceral hatred of them, the same to people who think the Palestinians can just fight their way to freedom they can't not can Israel suppress the quest for nationhood
Hamas wants to obliterate Israel, they believe it should not exist in any shape or form. They will fire rockets and they will look to kill Israeli's until either they're dead themselves or Israel is gone.
Why has Hamas built tunnels and clearly spent years fortifying its military infrastructure? Did they do all of that because they want to chat about a two-state solution with Israel around a table?
Hamas will continue to fight regardless and they will only stop and call for a ceasefire when it's time to reload because they have ran out of bullets. Once they have rearmed, the cycle will start all over again.