No. Rules are rules. They should be same for both sides. If one side broke them - another side shouldn't follow them either (until next big war and new set of rules established by its victors).The invasion of Afghanistan was absolutely justified.
Most of those wars/conflicts were a whole lot more complicated than a simple mass invasion.
The invasion of Iraq was clearly unjustified. Even in that case, the U.S. never wanted to annex Iraq permanently. Today Iraq is independent of the U.S.
The invasions of Mexico & Cuba were the only other ones that were unjustified - they happened over a hundred years ago. Neither were annexed.
We did not invade Serbia, Syria or Libya.
In Vietnam and Korea we were asked by the existing governments. We never annexed either one.
Russia recognized Ukraine as an independent country, made treaties with Ukraine then invaded Ukraine fully intent on permanently annexing Ukraine.
Using America's history to justify Russia's illegal & immoral invasion of Ukraine is nonsense.
Shall we list every atrocity in history as justification to commit atrocities now?
Should we consider the current invasion of Ukraine as justification for the German invasion of Russia?
They're about the same.
And, from the Russian point of view, their so called invasion was justified, too. They recognized DPR and LPR as independent states (as well as the USA recognized Kosovo), made a mutual defense treaty with them, and voilà - Ukrainian attack against DPR and LPR becames equal to Ukrainian attack against Russian Federation itself. And then - the whole Special Military Operation became pure and legal collective self-defense.
Yes, Russia recognized Ukraine as an independent state. But it doesn't mean, that the Russian Federation don't have a right to recall this recognition or recognize independence of other regions of the former Ukraine.
We shouldn't justificate any atrocities at all. But we should understand that our world is not ideal. We should try to avoid unnecessary violence and we definitely should try to defend equal rights for all human beings (including the Russians) and nuclear super-powers shouldn't violate vital interests of each other. Without that there won't be any reliable peace. We should talk with each other and try to find positive solution.