Can't think of an example in antiquity, but some in more recent times. Napoleon, Mussolini and Hitler did manage to more or less legally come to power and then replace a republican system with a dictatorship.