Unfortunately the latter is what has been happening in Iran where iPhones are not allowed to be sold. However in an attempt to curb smuggling, Gulf News is reporting (via AppleInsider) that the Iranian trade ministry is requesting licenses for nine importers so that they can bring in handsets like the iPhone.
In fact the iPhone, despite not being sold legally in the country, is apparently a pretty popular handset amongst the youth and the wealthier population. The government had initially tried to combat smuggling by cracking down, but it only served to fuel the demand more which in turn led to a price increase.
However given the sanctions against Iran, it would be quite complex for importers to buy the phone, at least not directly from Apple and might have to resort to purchasing it from third-party companies, which in turn could lead to an increase in cost, but ultimately it would be legal.