That's an impossible question to answer. Every country and every dictator are different. Even in the Soviet Union succession was not something written in a constitution. The succession of Stalin following Lenin was very different from Stalin to Georgy Malenkov which differed from Nikita Khrushchev's succession. And so on. The people involved were different, the situation each time was different, and later on the USSR didn't even exist anymore.
Lenin in his last few weeks advised against Stalin. He much rather saw Trotsky succeeding him. The Politburo found Trotsky a bit too revolutionary, so they elected the dull grey bureaucrat Stalin. Who was lots of things but not quite what was expected of him (dull and grey).
His highly unexpected succession was a literal Game of Thrones. Stalin was found in his bedroom paralyzed (or dead already). In the end, after several contenders* to the red throne were dead or removed from power, Malenkov was appointed. After the dangerous era of Stalin power was shared, with the chairman being more of a chairman and less of a Great Leader.
Even so, old habits die hard. Leonid Brezhnev revived the Great Leader a bit, if only because of his relatively long reign. You never become that in a few years.
The USSR collapsed, and became the Russian Federation. It was never a democratic society, more like some of the party elites became old style nobility revived. Putin rules as an autocrat, that is how most successful Russian leaders rule their country. Catherina & Peter the Great weren't exactly democratic.
Elsewhere more or less the same, being no fixed pattern. Franco of course knew he was going to die. He had already groomed and prepared an heir to the throne, in his case, a real heir to the throne. His preferred choice had been murdered in a bomb attack by Basque separatists. But he never foresaw that his final successor changed back to democracy as soon as he could.
It's different in every country, in every system and with every succession.
* this movie is a comedy, not a documentary. But it gives, in a humorous way, some insight in the political machinations going on.