The company intentionally targeted the San Francisco market. It's making payments to and contracting with San Francisco residents. That's usually enough to trigger jurisdiction. This isn't a uniquely American position to take. The EU goes after American companies all the time for violations of EU law.
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.