To take a conveniently forgotten example: the 1939 alliance between fascism (Germany) and communism (Russia), against capitalism (Britain and France) was far more natural than the subsequent alliance between capitalism (America and Britain) and communism (Russia) against fascism (Germany). But democracy was not the only enemy the fascist and communist dictatorships had in common.
Few people even seem to know this any more, but Benito Mussolini, who invented fascism in 1919 after the First World War, was a revolutionary socialist (what communists used to be called). He was therefore an international socialist who believed in the abolition of nations and world revolution. But the First World War forced him (and many other socialists) to recognise a fundamental point about human nature: people are more loyal to their country than their class. The key event was the decision, in 1914 by the French socialists, to support France against Germany in the war and then by the German socialists to support Germany against France.