North Korea absolutely holds elections and they can even boast with having 100% voting participation. Their last election was 2019. And so does China..
Anyway, you can't possible argue that Hamas is the legally elected government in Gaza after abolishing all other political parties and not holding an election for 20 years. Maybe they once was, but they're no longer and not since a long time.
You obviously have even a less idea about this whole subject.