A dog eating it's own poop is disgusting to us humans but perfectly safe and normal for the dog and there really is no harm in the dog eating it's own poop.
In fact the eating of the dogs own poop is actually beneficial to the dogs digestion and health.
But if you let the dog lick you in the face or come into the house then it's best to stop the dog from eating it's own poop.
Also if the dog is eating other animals poop then it could be harmful if the poop is infected with parasites or something else that could harm the dog.
If you go around places that have other animals poop you need to pull the dog away from the poop and tell them firmly to not eat that poop.
Or spray the dog in the face with some water if they begin eating another animals poop.
As for the dog eating it's own poop you should clean up the dogs poop often before the dog has a chance to eat it's own poop.
You can also add some meat tenderizer or canned pumpkin to the dogs food which will make the dogs poop taste really bad and the dog will not want to eat the poop anymore.
You just need a tablespoon of the canned pumpkin added to the dogs poop to make it taste bad.