Why do dogs have whiskers?

Like other animals, dogs use their whiskers for sensory purposes. For this reason alone their whiskers are indispensable.

Unlike humans, dogs do not have shoulders (at least not the same, or as prominent as ours). Their body is approximately the same width from front to back, except for a slight dip before their rear legs. So for a dog, there's no real way to tell if they're going to fit through something or not. We humans can make this judgement by use of our shoulders. If our shoulders go through a gap, then the rest of our body will. Dogs make the same judgement by using their whiskers. A dog’s whiskers when sticking out straight are slightly wider than any other part of their body. Therefore if their whisker fit through a gap without touching, then the rest of their body will too.