King George hired Hessian soldiers to fight the "rebellion" of the colonists. They were resented more than British soldiers, who also were considered "foreign" troops by the colonists.
Napoleon III wanted to install his own king in Mexico, but many Mexicans had different ideas. Napoleon III sent an army that hadn't been defeated in 50 years. It was routed by a much smaller Mexican army on May 5, 1862 (Cinco de Mayo). The Mexican Army was not exactly an insurgency in the hit and run fashion we normally think of, but it was fighting a foreign enemy. There is more to this story; see "Cinco History".
The German Army overran France in World War II and ran into another "insurgency". It may have killed many members of the French Resistance, but they were always replaced by others. See "Occupation Déja Vu". See also some of the articles in the side bar of "Occupation Déja Vu".
The Russian Army has its Chechnya; the Chinese have Tibet and Xinjiang. Only the Chinese may succeed in that they have the resources for the "Powell Doctrine" (overwhelming force). And like the U.S. against the Indians, a population ready to move in and displace the prior inhabitants.
The United States is just not ready to fight insurgencies, no matter how hard the members of the armed forces try militarily. They don't speak the local language, they don't understand the local customs, the local national government is corrupt and inept, the American people are unwilling to pay the taxes to provide ALL the tools needed, and no matter how little the purported enemies of the U.S. are supported locally, the people like the foreigners even less. And I wonder if we will ever learn.