"Off with his head!"
This is a favorite story line to show how cruel a king (or a sultan or emperor) can be. The rules in this type of government are pretty clear. Whatever the ruler says, goes. Of course, many people have had different ideas about how the ruler should govern, and those beliefs support totally different types of government. The rules shape the government's legitimacy, or the degree to which the people accept the authority of the government.
Countries whose citizens are governed by the absolute decisions of the ruler have not necessarily been unhappy. A government whose king or queen rules justly and wisely may enjoy a great deal of legitimacy as long as the ruler's authority is accepted. Sometimes people may accept their leader because they are afraid of the consequences if they don't. In the words of Machiavelli, "It is better to be feared than loved." As long as the feared ruler is seen as bringing about prosperity or protecting the lives of his subjects, it is entirely possible that his people will be happy.
An absolute ruler may be accepted because the people believe or accept the idea that God gave him/her the right to rule. This belief is known as divine right, which often has been associated with a monarchy, a form of government in which the power of the king or queen is hereditary. A similar idea legitimized the Chinese emperor, whose rule was threatened if his subjects perceived that he had lost the "mandate of heaven."
Rule by man can also take the shape of an oligarchy, or rule by a few elites whose right to rule is based on possession of wealth, social status, military position or achievement. A little more broadly based rule is by aristocracy (literally, "rule of the highest"), but if the type of government is "rule by man", their decisions are still arbitary and absolute.
Rule by law exists in any political system in which those with power cannot make up all their own rules, but must follow an established code of law. In ancient times a Byzantine emperor established Justinian's Code, a set of laws named after him that lived on long after he died. We still follow parts of that code today. The Romans were also known for codifying laws, as was Napoleon, Emperor of France, many centuries later.
Today most governments at least claim to be ruled by law. The most common indication is the existence of a written constitution, but the most important question to ask is whether or not the constitution actually is the "blueprint" that determines how and what policies are made. For example, Nigeria officially is a democracy with a written constitution that one dictator after another has ignored. On the other hand, Great Britain has never had a constitution as a single written document, but has for centuries been governed by law. For much of their history, the English had a limited monarchy, or a king or queen who has followed rule of law.
So whether a king can order "off with his head!" depends on the type of government that is accepted in his country. If he sets the rules (rule by man), or if the accepted outside rules allow (rule by law), the victim doesn't have a chance.