Of course, these days, you are likely to have to offer an explanation of who Onan was (see Genesis 38: 9-10). Nonetheless, clever funny or even risque names will bring a chuckle (or gasp) among friends and acquaintances.
These kinds of names are probably best suited when you adopt an adult dog...ones whose habits and personality is well-established.
Think of a dog who has given you a number of minor things to complain about...you might name such a dog Peeve (as in, that's my pet...).
A dog who constantly licks their groin can also be called Onan if he is male and Lickety (as in lickety split) if she's female. If you want to be even more crude, name him Scrotum if he's a boy and Clitoris if she's a girl.
A dog who is fat, flatulent, neutered and barks to excess can be called Limbaugh.
A dog who enjoys looking at themselves in the mirror can be called Narcissus or Mitt if he's male or Madonna of Khloe if she's female.
An old dog who acts like a sexually active young dog can be called Jagger if he's male or, again, Madonna if she's female. Again a more crude version might be Dawg or Bitch, depending on gender.
Just take a good look at their habits.