At some point in just about every dog's life, he or she will try eating their own poop, or sample the cat's litter box. It even has an official name, Canine Coprophagia.
Reasons
Actually, it is a very natural habit for a dog in the wild. Mother dogs will eat their puppy's feces in order to keep the den clean. Puppies that see their mother do so will often imitate her. A dog confined in a cage for long periods of time may be trying to clean his personal space. If stools are left to pile up in the yard, it may prompt the dog to clean up his stools. They may be suffering from boredom, loneliness, anxiety or stress. If a dog is punished for going in the house, he may eat his feces to hide the evidence. Or there could be a health reason, like internal parasites that make the dog feel unusually hungry because the parasites are taking the dog's nutrients.
Prevention
First, clean up your yard and pick up stools as they happen. If your dog tends to eat feces immediately after going, be sure you're there with him and divert his attention with a treat or a toy while you pick it up. If eating from the cat's litter box is a problem, confine it to an area where the dog cannot enter. If confining a dog to a cage while you're away, give him a variety of toys to make the time less monotonous. Never punish your dog for going in the house. A dog only goes in the house if he can't hold it any longer; it's a myth that they do it out of spite. Finally, if you suspect parasites, get him to the vet for treatment.
Try adding a few chunks of zucchini to his food, as it is acidic and makes the feces less tasty. There are also some natural products to help with this problem which contain glutamic acid that you add to your pet's food. When mixed with stomach acids, glutamic acid makes the stool taste very bitter to the dog.
It may take some perseverance to break your dog of eating feces, as it has become a habit that they enjoy, as disgusting as it may seem to us.