Pretty facetious comparison. Iraq and Afghanistan were on the whole a mistake, but completely different from Ukraine. There was never any idea that the US would take the territory. It was just a huge waste of money for the US.
The very best case scenario for the US (which everyone realized was never going to happen within 2 years) was something like Japan and South Korea, setting up US-friendly democratic governments and corporations. There was absolutely no element of expansionism. Ask the Japanese and the South Koreans whether they are mad about being oppressed under the thumb of "US imperialism".
Contrast this with Russia's actions in Ukraine. They are taking over economically and militarily valuable lands, directly expanding their borders, expelling or re-educating Ukrainians who won't pretend to be Russian, and nakedly pursuing the revanchist fantasy of reclaiming lands that were ruled brutally by a totalitarian Muscovite empire for hundreds of years.
Conflating the two situations betrays an extremely shallow understanding of current events and a complete ignorance of history.