There are many examples of elections won by socialist/communist parties. There would have been more of they weren't outlawed or suppressed historically.
There are also examples of revolutions that didn't end in authoritarian regimes, for example the ones that ended in anarchist communities.