China still struggles with that. A traditional question is "what is your village?", to get name uniqueness in a system which has too few family names.
France at one time went to the other extreme - names had to be approved by a central registry at birth. Until 1993, there was an official list of allowed first names. Today, there are still some prohibited names. "Nutella" just made the list.
A clarification: it's not so much that there's a list of prohibited names, it's more like some people had "clever" ideas and the legal naming process has a judge involved to validate that names are not outrageous or could cause harm to a child. Once it's been ruled out, it's unlikely to have a different result on a second occurence.
Examples (from the process above: keep in mind people actually tried)
Fraise: (strawberry) because of the expression "ramène ta faise" ("bring you ass over here")
Jihad: for obvious reasons
Joyeux: (happy) from the dwarf name
Patriste: (notsad) an attempt to circumvent the above
Babord / Tribord: (port / starboard) someone tried that for twins
MJ: trying to honour of Mickael Jackson's death
Griezmann Mbappé: you can guess
Mégane: because the family name was Renaud (close to Renault, which has a car named Mégane)
Mohamed: because the family name was Merah (Mohamed Merah being a well-known serial murderer)
Fañch: a traditional Brittany name, initially rejected because the ~ diacritic, which does not exist in the French alphabet. Was later overruled and allowed.
The horrible part, though, is about all those terrible names that are not rejected as the ones above were but are obviously a sort of sad, tasteless joke and very very bad for the child.
France at one time went to the other extreme - names had to be approved by a central registry at birth. Until 1993, there was an official list of allowed first names. Today, there are still some prohibited names. "Nutella" just made the list.