In the wild dogs are scavengers, meaning they’ll eat whatever they can find. Some pet dogs are the same and will eat anything they find lying around.
There are lots of foods, items and substances in the house and environment that can poison dogs or block their guts.
Treatment and outcome varies a lot depending on what it is your dog has chosen to eat.
Contact your vet immediately if your dog has eaten something harmful. Acting fast could save your dog's life.