Pretty much anyone can leave if they have somewhere to go.
It isn't North Korea.
“Pretty much anyone can leave if they have somewhere to go.”
Not that easy. It can take months to get a visa to travel to another country. And if you haven’t travelled much outside of Iran, you may not get one. And, even if you have all the paperwork, it’s no guarantee that you won’t be stopped at the airport & have your passport confiscated. And women travelling alone need permission to leave from a husband or male relative.