The Legal Equality is the idea that all people shall be equal before the law.
Most of the countries, though, implemented this idea in a Rule of Law form, which states that all citizens, or members of society, should have equal rights. So technically it allows some individuals to be excluded from the definition of “members of society,” leading to the deprivation of their basic human rights.
This loophole has been widely exploited by various governments to enact oppressive laws targeting specific groups of people. Perhaps the most notorious example is Nazi Germany and its anti-Jewish legislation.
During the Nuremberg trials the defendants argued that they didn’t commit any crimes, because they followed the German law at the time. To oppose that argument, the court used Radbruch formula, created by German law professor Gustav Radbruch. According to this formula, if a law “deliberately disregards” human equality before the law, it must not be followed.
Today, the Radbruch formula is embedded into most civil law systems worldwide, making it illegal to dehumanize people and evade accountability. It’s worth noting that the legal systems of the USA and Canada operate differently, and I couldn’t find any mentions of the formula in those jurisdictions.