Dogs have incredible memories for where they found food. The best way to prevent the dog from eating eggs is to keep them out of reach, i.e., in a nest box in a coop. And chickens and ducks are creatures of habit. They can learn new habits but you have to be persistent.