Israel and Hamas don’t agree on much, obviously. One glaring exception is the two state solution, neither side has any use for the two state outcome.
Both sides recognize they are locked in a death match, which can have only one winner, with the loser left dead on the field of battle.
Who does want a two state solution? Nearly everyone else. The so-called “Palestinians” are a people with whom nobody wants to share their country, not Arabs, not Israelis, not Westerners, nobody.
The two Arab countries which have taken in Palestinian refugees - Lebanon and Jordan - have had much grief with them. Palestinians need their own country but nobody wants to share a border with them. As neighbors, they are as popular as a wasp nest.