I feel your pain. I have two dogs and two dogs and my male dog is always snacking out of the litter box. We’ve tried turning it towards the wall, putting it in the corner and putting a lid over the top. My dog is big, but he still manages to fit his fat, lab head in there. Then he comes up stairs (cat bin is in basement) and right up in your face. His breath is so bad, you can smell it from across the room. One day, during the winter, he came in from outside and plunked himself down on the floor and started chewing on something crunchy. Turned out to be frozen dog poop- a poopsicle!
Any way, my female dog does NOT do this, although she LOVES to roll in deer poop. As we live out in the country, this is very accessible. Since she’s a huge St Bernard, baths are NOT easy.
There are products that you can put in both dog and cat food that supposedly stops dogs from eating both kinds of poo. Unfortunately, they don’t work for my dog.