If the dog is a service animal, the driver is required by law to transport it.
Pets are a different story, but not usually a problem. Most Uber/Lyft drivers will accept a pet if it's well-behaved...and especially if it's in a carrier. The thing we are concerned about is damage to our personal cars -- either by an "accident" or by biting/scratching upholstery.
Pets are a rare situation -- I have about 2,000 rides and I've had exactly two dogs -- both pets, one in a carrier, the other not, and neither service animals. They were zero problem.
The best thing is to just call the driver while they are en route and tell them the situation. If they object, cancel and re-order and call the new driver.