Why would a dog eat their feces?

"First, when dogs eat their own poop, they are said to be practicing a behavior known in veterinary medicine ascoprophagia. It should also be noted that this behavior isn't limited to incidents where dogs eat their own poop. Dogs will sometimes dine on the feces of other dogs, cats, horses, or other animals. In addition, some dogs enjoy "poopsicles" exclusively and prefer to just eat poop during the winter months.
Secondly, while the act of eating feces may seem revolting to humans, dogs simply consider it fair game to eat feces. After all, dogs are pack animals, which means they are scavengers. From their point of view, anything that smells remotely edible left lying on the ground is permissible. Since most dogs are fed meat-based food, whether wet or dry, it's reasonable to assume that the end waste product contains undigested portions with similar characteristics. This is one popular theory as to why dogs eat their own excrement.
Another theory offered to explain why dogs eat their own feces is poor nutritional status, or a deficiency in pancreatic enzymes. This theory also holds that dogs instinctively attempt to correct such imbalances by eating feces. To counter this activity, some veterinarians recommend adding an enzyme supplement such as papaya extract to the dog's food, or even something as simple as powdered meat tenderizer. This approach has the added benefit of aiding digestion to make eating poop less attractive to the dog in the first place.
Puppy-hood presents a different psychology when it comes to eating feces though. First, it is normal for the mother to eat the feces of her young pups since this is how she cleans the den. Secondly, she must teach her pups to eliminate by stimulating them through licking, and no doubt partake in a puppy poop snack now and then. In addition, puppies can easily become confused or frustrated during housebreaking and may eat their own poop to avoid detection of accidents."

A2. Rabbits in the wild also eat their own droppings. But this is to recycle some partly digested food that is now more available due to partial processing.