The Rule of Seven was a law that was known to the Vulcan civilization.
The closest Starfleet regulation that matched this law was when a Commander was possibly unfit to command through no fault of their own. The Rule of Seven was non-punitive which meant that it was not considered a blot on the individual's career. Furthermore, it required no proof or hearing and whilst one could request one, they would have had to leave the ship.
In 2274, S'haile Savaj declared the Rule of Seven and asked that Spock take command of the starship USS Enterprise from Captain James T. Kirk. (TOS novel: The Prometheus Design)