There are lots of reasons why one should be wary of having dogs or cats around their bird.
Birds vary in size. It is safe to say that a small bird like a budgie, canary, or finch will be ideal for dogs and cats. They move quick, flapping and running - a trigger for both dogs and cats to hunt and chase. This will probably also be true for the slightly bigger birds such as Conures and some Cockatiels. The biggest birds like Amazons and Cockatoos may not trigger the same instinct to chase because they can be intimidating however, dogs and cats still pose a threat to them.
Dogs tend to eat the bird they chse. Hunt, chase and eat. Don't let that happen.
Cats are a little different. They do have an instinct to chase and play with small birds. They don't generally eat them. However, even if you think your cat won't hurt your bird they COULD. Cats naturally have Pasteurella Bacteria in their saliva and on their claws. A swipe of the paw, A graze across the teeth, could be fatal. Even if you think your bird could have been exposed to that bacteria, I recommend taking your bird to the vet IMMEDIATELY.
Simple enough. those are main reasons. When instinct kicks in, even the best behaved pet will behave like the animal it is. Don't risk your bird's life just because you think it's cute that your dog or cat wants to play with your bird. There's your warning.