Yes, but in both cases, Japan and Germany feared being occupied by a neighbouring country in which they'd committed terrible atrocities. China and Russia, for example.
That tended to give them a much more favorable view of their current occupiers, seeing as they were far less likely to set up concentration camps then the alternatives.
There is no such analogy with Iraq. If there's one thing the Iran-Iraq war taught the Iraqis, is that the one thing they never have to fear is being occupied by Iran. ;>