Sniffing is the way they explore the world, and our balls is the area where we have the most pungent odors. The same goes for armpits. Being human, we have different glands in our genital area; they are scent glands, and dogs sniff your balls; they want to figure out what they can do about that scent gland. Dogs have an excellent sense of smell, so usually, when you have recently masturbated, they tend to sniff your balls.