The real issue is whether a judgment in another country can be enforced. If MonkeyParking has any physical U.S. presence (bank accounts, servers, etc.), San Francisco could try going after those items. They're an iPhone app, so SF could certainly go after Apple. Assuming none of those options are available to SF though, SF would have to go to an Italian court and ask that court to enforce the U.S. judgment. At that point, whether the decision is enforceable would hinge on international treaties and Italian law.
In your Iran hypothetical, Iran could certainly claim jurisdiction over an American software company for intentionally violating Iranian law. But the American First Amendment prohibits American courts from helping Iran enforce that judgment.
The right to speech and free expression is protected in the U.S. (for the most part) whereas the right to affordable parking is an arguable point. The primary issue San Francisco had in this whole episode is that they didn't come up with it first. This was all about revenue.
MonkeyParking is not located in San Francisco. MonkeyParking is not even in the United States (the company is based in Rome, Italy). The founders aren't US citizens. If the mayor of some random Iranian town demanded an American app shut down, because locals were using it to coordinate protests against Islam in violation of Iranian law, there's no way in hell an American software company would listen. Do US courts simply claim that their laws apply to everyone, everywhere?