The codes exist but I think what they are saying is that in some places codes are not enforced or even checked. I live in somewhat of a
"middle ground" where codes do exist and electrical is checked on a brand new build. They will also nag about septic inspections but will never actually get off their butts and do the inspection. Many such places do exist
but they are usually places I would never want to reside. I know of places that I can literally build anything and never once be nagged by inspectors or state/county governments. They are happy enough
and lazy enough to receive the property tax revenue.
I have mixed feelings about unenforced regulations. Having unenforced regulations opens up the possibility of targeted abuse of any individuals that are not a cultural fit in the eyes of the government offices and being very relaxed regarding anyone that fits in. This also drives the need for very detailed and expensive inspections prior to purchasing a home and that is a loaded topic all by itself.