The nuclear non-proliferation effort and NPT have been slowly melting for decades, and now nears total collapse. This latest North Korean nuclear test is only the latest evidence of this trend. On the other hand, Fareed Zakaria postulates that Iran may not want the bomb.
Short of invasion, what can realistically be done to avoid Iran or North Korea acquiring nuclear technology? Nothing, for both NoKo and Iran well know that a nuclear device is a major bargaining chip, a major international status symbol.
Post-Iraq, it seems like any consensus for political violence (war) is absent, if it ever existed, even in blatant presence of a nuclear weapon-capable technology.
Iran and North Korea are both militarily and politically difficult to attack. Sanction regimes, the traditional carrot-and-stick, appear ineffective. The ever-rumored Israeli attack on Iran seems unlikely to induce Iranian regime change, or reduce Iranian desire for nuclear capability.
Therefore, it seems likely that Iran and North Korea will gain enriched uranium capability, and similar technology, while avoiding war.
Given that, other nations will move rapidly to acquire nuclear capability of their own. Iran and NoKo will join Israel, India and Pakistan as political cover for many nation-states to develop or acquire nuclear technology.
I could even see the Russians moving in to exploit such a situation, by playing arms dealer to a willing world. If the USA won't sell nuclear technology to the Middle East, Russia will. Iran was merely the first customer of Russia Arms, Inc.
Much appears to hinge on Russian willingness with regards to Iran... but even a best case scenario would only slow, not stop, the march of nuclear progress.