How?
Who's going to join on the side of Iran in nuclear war?
Radicalized governments in Pakistan and Egypt would be one scenario. The other might be that Iran manages somehow to set off a nuclear detonation in Israel, and Israel nukes the Middle East.
There could also be alliances formed with Russia or China or the even the EU. History is full of odd twists and turns.