A dictator government has control over all affairs of a country and does not submit to any law because it is he who decides the rules.
In a democracy, the rulers are elected to command the country for a restricted space of time. Still, a democratically elected president has no power to control everything either and neither is it immune to the law. Quite the contrary, there is a division of powers between the judiciary, legislative and executive, precisely so that there is moderation and supervision between each independent power.
Legislative power creates laws, executive power obeys laws, and the judiciary enforces laws. However, in didaduras, the executive power captures the other powers and decides on everything, staying even over any law. Some examples are Venezuela and North Korea.