Yes. But note that armies are a hierarchy with little flexibility once orders start coming down. When democracies want to achieve outcomes they set up (subordinate) dictatorships. The army does not stop to vote in the middle of a war. Indeed, sticking to the Ukraine example, they suspended elections as I assume is usual in war.
Democracy is a better model of governance because the military can focus on winning wars. In a dictatorship, the military has to focus on keeping the dictator in power - otherwise the dictator will get rolled. Since authoritarianism can only do one thing at once, generally they have a weak military at the expense of stability.