Some dogs are copraphaeggic. Try putting a ring of pineapple with her food. There is something in pineapple which makes it unattractive in poo. Of course that won't work with other dogs poo. Try either keeping her on the lead until you break the habit or get her a remote controlled collar which emits lemon spray. When you see her misbehaving you press the remote and the spray is released. These collars are very effective. You are right to be worried about this habit as she could well pick up worms this way.