The US constitution’s supremacy clause allows for this too
But because higher governments derive their existence from the support of the lower governments, laws are frequently written to allow opt in by lower governments
California very commonly inverts the supremacy relationship
Municipal level governments don’t practice the county’s laws unless they opt in, and don’t practice many of the states laws unless they opt in
Exceptions apply
A lot of the burden is from federal requirements (NEPA and the APA) that subject every government action to endless litigation. In Spain and France, the laws authorizing transit projects also bar challenges under many corresponding national laws. The idea is that the government has made the decision to do something after extended consideration, and that's that.