No ISIS is Sunni, Hezbollah is (mostly) Shi'a (and works mainly in a country that has a long history of religious toleration). Hamas is sunni. Egypt is also Sunni, but hamas and the muslim brotherhood are somewhere between allied and the same thing, and the muslim brotherhood is the mortal enemy of the current Egyptian state (they got control of the state, and used it to start to kill some groups and loot, at which point the army saw the risk of food supplies to the country getting interrupted, and started shooting the muslim brotherhood - not that they were friends before)
So ISIS want to kill every last Iranian. Iran, by contrast, shares it's religion (and half of it's government), with the dominant faction in the Iraqi government. So Iran is naturally allied with the Iraqi government, and, for the moment, with America (they have toned down the rhetoric at least. And keep in mind they are allied with America for short-term strategic reasons - keep Iraq from falling over. They very -very- much disagree with America's proposal to share government power between factions in Iraq, they'd rather just subjugate the sunni's like they've done in Iran, you know, force their kids to go to Shi'a schools and the like (which isn't nice, but keep in mind those sunnis would like to murder them)).
Keep in mind ISIS represents the majority sunni in Syria and the minority sunni in Iraq, and wants to exterminate all other factions in both places. That's what they're fighting for.