Setting up garden gnomes is not forbidden. What you should refrain from, however, are obscene garden gnomes. You don't have to tolerate this from your neighbor either.

Is there anything we can do about it? Courts say: No! The neighbor can set up as many gnomes in his garden as he likes. Nor does he have to stick to any limits. Dwarves may be placed next to the fence provided they remain on your property.
Obscene Garden Gnomes
However, in the past, dwarves who violate good manners and make obscene gestures have appeared more and more frequently. You don't have to tolerate this easily. For example, if there are dwarves dropping their pants or giving the finger, the neighbor can demand that they be removed or at least out of sight. It's best not to set up such dwarfs at all, so nobody feels provoked.