Ahmadinej, whose country is locked in an international stalemate over its own nuclear program, made his comments on state-run television.
He also rejected as "illegal" a Security Council demand that Tehran suspend its own uranium enrichment.
The U.S. ambassador to the UN, John Bolton, said on October 15 that the tough sanctions against North Korea should help convince Iran to cease its sensitive nuclear activities.
Washington has long argued that Tehran's nuclear efforts are aimed at developing weapons, a claim that Iranian officials have consistently dismissed.
Ahmadinejad suggested Pyongyang's claim that it detonated a nuclear device emboldened his country in its own standoff with the Security Council and the International Atomic Energy Agency (IAEA).
IAEA Chief Urges Greater Controls
The director-general of the IAEA says that as many as 30 countries could have the technology to develop nuclear weapons "in a very short time" unless better controls on proliferation are implemented.
Muhammad el-Baradei made his comments today at a Vienna conference on proliferation. He said more and more countries are developing technology that would allow them to develop nuclear weapons on short notice.