Bingo!
Very good question my friend. Saudi Arabia has already purchased a few nukes from Pakistan. Like ordering a Domino's pizza. I doubt Russia or China would sell them any. North Korea does not have enough to give away. But Pakistan is a whole different animal. I'm more concerned about a nuclear armed Pakistan than I am with a nuclear armed Iran.
Pakistan has a corrupt government and culture. Just look at the history between the U.S. and Pakistan. Why do you think Osama bin Laden was hiding in Pakistan? Why do you think the Americans did not tell the Pakistani government about their upcoming raid on the bin Laden compound? The Pakistani military is not very reliable in securing their nukes. Pakistan has a nuclear black market. India would not sell nukes to Iran.
Iran is Persian and practices Shi'ism Islam (Muslims). Pakistan is made up of Sunni Muslims. Not sure if religion would be an issue, but yes, they could do just that -- buy a nuke. But Iran does not need help. They have everything they need to build a bomb. My guess is that they already have one, a rudimentary atom bomb - not thermonuclear. They would most likely want to say that they don't need outside help to build up a stockpile of nuclear weapons. National pride, like India, North Korea, and Pakistan.