Generally speaking, in D&D, even the gods have limits
How many evil magic-users are there?
Some races (elves) may be immune to charm effects.
What are the good adventurers doing in the meantime?
Some gods and their clergy may object, and they will have very good wisdom saving throws.
In the "real" world no plan survives contact with the enemy.
In the city of Kelvin of the Grand Duchy of Karameikos spellcasting is forbidden. This is in Mystara, one of the first campaign settings for D&D.
The idea that magic is bad for public order is as old as the game.
The case of the scheming evil lich
Bob is a level 1 wizard who wants to take over the world.
Bob, being an evil genius, knows that his powers are not enough to take over the world, yet.
He starts building his network of evil, acquiring new and more powerful spells and items.
During his rise to power Bob makes enemies. The Paladins of the Order of the Sun are crusading against him. Other evildoers want a slice of the cake.
Bob manages to corrupt the paladins and turns them into his personal army of darkness.
After the tenth assassination attempt Bob decides to ascend to lichhood by some foul ritual, just for convenience.
By any means necessary Bob gets rid of his competitors and becomes king of the world.
But the gods are not happy about what he's done with their creation and start sending emissaries to destroy him, make him repent and free the masses from his grasp.
But somehow, Bob manages to become the one and only god and annihilates all the others, a feat never performed by anyone before. Now he's king of the universe!
Assuming there isn't any pesky Great Old One prancing around...
Bottom line
If you want to set your campaign during Bob's rise to power, you can absolutely do that.
If you want to set your campaign in a crapsack world, you can absolutely do that.
If you want to switch from D&D to Paranoia or Dark Heresy, you can absolutely do that :D