This question already has an answer here:
Is the Ministry of Magic elected? Is the (British) magical world a democracy? What political parties exist? How are elections organized? How frequent does one can/have to vote?
In Harry Potter and the Half Blood Prince, we learn that Albus Dumbledore was offered the post of Minister for Magic three times. This seems to imply one at least doesn't have to volunteer to get elected?