I would argue that Iran, Russia, and a few others are not rational and not acting in the best interest of their survival. They may have dictators acting in the best interests of themselves/the ruling class. Any time you are willing to sabotage your country’s wealth/economy at the expense of political/geopolitical/human/etc. capital and a plurality’s (at best) religious views, it isn’t rational. It isn’t rational to chant death to America or to disappear your own citizens at scale for breaking morality laws like showing your hair as a female. It isn’t rational to sponsor terrorism for ideological reasons when the result is sanctions that erode your economy severely for years to the point the populace despises you at the majority level. Or use proxies to attack countries that could quite literally destroy you.
It isn’t rational to invade a neighbor unprovoked and spend 4 years and countless lives fighting a protracted war for territorial gains that make the trench warfare of WW1 look like the Blitzkrieg. Especially, when you’re already the largest country by landmass and one of the most thinly populated. All while sanctions and the mounting costs of that appallingly stupid decision reduce your economy to the point you’re basically bartering with other autocrats to survive and your former image as that of a major world player and a somewhat respectable military power crumbled years ago.
As someone who supports the Western liberal order I agree, Russia and Iran aren't acting in the interests of their own people. It's better for the international order to have a secular government operating in some sort of democratic fashion, to transition from a resource-based economy to a knowledge-based one, and to pursue the types of policies that open up their economies and create a healthy middle class. It's in the US (and the world's) interest to have stable and healthy countries which can be relied upon as regional partners. So in that context, yes, they appear to be acting irrationally.
But the authoritarians which rule Russia, Iran, North Korea, and other countries, view their own regimes as the state. It's why a common refrain on Russian media is that "a world without Russia is no world at all" right before they make their hourly quota of threatening nuclear desolation against Ukraine, Europe, and the US. If your entire goal is continuance of the regime, disappearing, imprisoning, and killing dissidents within your borders is a rational act. Creating the specter of a foreign enemy like Russia has with NATO, or Iran with it's 'Great Satan' of the US and Israel (or as I said earlier with the idea of Taiwan existing is more useful to China than actually conquering it) is rational because it creates an other you can blame your countries problem on. IE, we were sanctioned because the US is a villain, not because the regime is becoming geopolitically isolated.
Iran got 30+ years out of funding terror cells in the Middle East to bog down Israel and the US' own military adventurism - gun running to Hamas and Hezbollah is a rational act to give your enemies something to focus on rather than you. Russia sees the former territories of the Russian Tsardom and USSR as rightfully there's - invading to create a buffer zone to protect the cultural heartland of Muscovy is so deeply ingrained in Russia that it's governed their geopolitics for the last 300 years.
The control that an authoritarian regime is able to exert over the apparatus of the state makes them fundamentally the state; therefore they act in the best interest of the state, because that itself is the best interest of the regime. Even when such actions are at the expense of the citizenry, which exist solely to serve the state.