Not really true in the real world it’s what one person or group in charge deem to be law and that changes around the world. At best you could say at any one time the leader represents about 60 percent of what society wants but they only get two vote choices most of the time so may not like either much. Law is definitely not what society deems respectable though. Law is set by a small handful of rich officials. I’m sure most ppl don’t want to pay huge energy bills or people without kids don’t want to pay for schools or Christians don’t want to pay for mosques etc the government is supposed to act in ones best interest but it mostly doesn’t, did we all want to pay billions for a track and trace system that most people probably didn’t want, does China and Russia in the most part want to have no free speech and not be able to express their opinion on social media... probably not.
Blockchain was supposed to be different in that it actually took the opinion of the majority etc and made that law through code so it couldn’t bring in personal opinion. Even vitalik gets that cause he gave his opinion on the Ukraine war but said ethereum has no opinions... Ie ethereum can be used by any side. If we equate it to punishment for a crime it would put everyone who committed the same crime in the same punishment after looking at the distinguishing factors. Right now no one rich has ever got the death penalty, it’s heavily stacked against black people too when it comes to death penalty. This is an example of how the law can be sort of bent a little on specific situations and is not really fair just because one person can afford a much better lawyer than the next man.
Actually Blockchain could make it so the law is what society deems acceptable, people will never do that cause they have opinions, triggers, personally favour people, have fears etc. A blockchain set with certain parameters that are most in line with the majority of people is probably the fairest system and the only way you could uphold mass opinion.
Most law is debated at length and not simply "set by a handful of officials, rich or meager", but by the representatives who are beholden to their constituency. So yes, law is society's consensus, which is predicated on whatever the society deems respectable, even the rich officials are operating from society and by society.