Pakistan's nuclear weapons are meant to balance India.A strong India is not in everyone's interest.Pakistan is one of the few countries in the world with military support from China, THE United States and Russia.Developing nuclear weapons requires international political support, and Iran's status as an independent regional power is a strength, but also a weakness.Nobody supports Iran getting a nuclear weapon.It's not just Israel, it's Saudi Arabia, it's Iraq.
North Korea's nuclear weapons are also based on a dangerous balance of international politics.America needs to threaten South Korea and Japan with North Korea to keep its troops there.China needs North Korea as a military buffer on the Korean peninsula, and north Korea's military is not strong enough to withstand South Korea and the United States.Neither China nor America likes North Korea's nuclear weapons, but they are not staunchly opposed to them. North Korea is a master of international politics, using geopolitical niches to gain limited nuclear power, then decisively renouncing nuclear weapons and winning the goodwill of international opinion.
What Iran really needs is to secure international political support, not to forcefully pursue nuclear weapons in such a situation.Otherwise, you will only isolate yourself.