I think a big part of the problem with Iraq was that there was no plan. And it was based on lies. The US went in as a preemptive strike saying that Iraq was manufacturing WMDs. Later they admitted that they lied. And then there was no plan, there was neither the claim to free the people nor a plan on how to go about it or any kind of long-term committment. The result was the rise of the IS, borne from former elite soldiers of the Iraqi army who were replaced with noobies by the US and allies IIRC.
I'm not going to pretend that everyone would be fine with it, but had they had a more decent plan about how to fix the country, or, even better, had they actually fixed the country the first time they invaded in the early 90s, there'd have been far fewer complaints and problems.
Dariush already mentioned how the US basically played with the country for decades.
Right is obviously the conservative option.

Otherwise it depends so much on the circumstances IMO that one cannot make a general rule. The only rule there might be is that when the major motivator to go in and "help" is that one expects huge benefits for one's own national interests, it is very likely to turn sour. If one goes in to help, there should be some altruism involved to make it more likely to work and be received well. With enemies like the Taliban even that rule is not universally true though.
Bookmarks