Simple answer. Iran is an authoritarian government, a theocracy that is run by a bunch of mullahs. As such, they could (and possibly did) quash any dissent by mobilizing the Revolutionary Guards. For all we know, Iran may have forcibly kept the refugees out. Pakistan is somewhat freer than Iran, and not a theocracy, and is a government, that at least to a degree, believes in a democracy and open society of some sort.