This is the same argument people used to push the idea that Russia could not effectively administer the territories of Ukraine that it took. Yet despite their myriad failures, the Russians actually have managed to pretty effectively crush Ukrainian partisan activities within the land they grabbed, in an area over 100 times the size of Gaza. I don't know where this idea came from that effective COIN is just flat out impossible and fighting guerillas is a pointless effort but it's not true; if insurgents do not have room to retreat and cannot be resupplied then they basically always lose. Thailand for instance was able to decisively defeat rebels in its southern panhandle by securing the cooperation of Myanmar and Malaysia, thereby denying them the ability to retreat across borders or smuggle in supplies.
Sorry but this is just wrong.
Ukraine is largely flat farmlands, and the areas occupied by Russia had been under years of attack from Ukrainian forces due to secessionism. Russia had literally been supporting the Ukrainian partisans.
The IDF, on the other hand, is moving through a dense urban jungle filled with people who had been living under Israeli oppression for decades.
While the difference of strength between the IDF and Hamas is lopsided enough that eventually the IDF will come out on top, this is not in the least bit comparable to the Russian/Ukraine situation.