I believe what you are referring to here is the idea of primary and secondary rules. Primary rules are the rules that are imposed by authorities on the common people of a society. They are the commands of the sovereign that must be obeyed. Secondary rules are the laws that give authority to the rule makers -- the laws that say how laws must be made, etc.
In order for a legal system to be valid, the following things must happen:
- People in general must obey the primary rules.
- The people who make the primary rules must accept and obey the secondary rules.
If these conditions are met, a system can truly be a legal system.