Hamas was more prepared than ISIS. Better equipped. More tunnels. And the population density in Rafah was higher.
Also the British, Canadian, Australians, Americans, etc. did not send any of their soldiers to go house to house. They sent the poor Iraqis. After demolishing the place, killing a ton of civilians in the process.
Easy for you to say that Israel should have sent its soldiers to be ambushed house to house, blown up by booby traps in houses (which happened a lot despite the tactics), blown up on the streets by mines etc. I mean that's how Hamas wanted it to play out and obviously not the way Israel was going to do it.