Anyone can be king. But there are technicalities that fall into that. If you're a farmer, then stroll into town one day and stab the king to death, that doesn't entitle you to become the new king. It's a bit more complex if you wanna go from farmer to king, but I'll do my best to give you an example of a way that I personally could see working.
The kingdom is at war. You enlist in the king's army, and hone your combat skills. You earn the respect of your comrades and quickly rise through the ranks. Eventually you become a general with a large following. As the war gets more heated, you slowly acquire more political control as well, as many nobles trust you to protect their lands. Eventually you gain enough favor, and rally a coup, calling out the king for being a weak leader and claiming you can lead the kingdom to swift victory. The nobles crown you as the new leader, and you either fulfill your promise, or get murdered within a week.
Now, I'd like to stress that this is possible, yet very difficult. Again, the point is anyone can be king, but that doesn't mean it's easy by any means. It'll require a lot of dedication, luck, and the charisma and skill needed to gain and keep support in your favor.
EDIT: For a real world comparison, study Gaius Marius and his exploits