Yes of course you can't name your child Shit Head. Is that a thing your government will print on a birth certificate?
Denmark did use to have "These and only these names" and they were written into the law (yes, there are pages and pages of Danish legislation that are just names), but now any non-offensive name is okay, and for administrative purposes, an "approved"-list is kept for easy reference to things that have already been, well, approved.