A pedestrian passes the window and your dog erupts before you can say a word. In a car, the world moves close and fast, while your dog cannot choose to move away. Excitement, worry, and frustration can look similar from the front seat.
First, keep driving safe. Your dog should be properly secured so they cannot reach the driver or lean out of the window. Check a suitable restraint for the dog, vehicle, and local rules. Do not turn around to train while driving. If barking is making driving unsafe, pause car trips with your dog until you have a safer arrangement.
Take the view down a notch
If possible, use a safe, ventilated setup that limits the dog's view of the busiest side of the road without obstructing the driver's view or interfering with restraints. Start with short trips on quiet roads rather than a crowded school run. Watch whether your dog settles when they can see less, or whether sounds and motion still upset them.
Practice while parked safely, with another adult handling the dog. At a distance from passersby where your dog is comfortable, reward them for noticing a person and remaining able to turn toward the handler. End before they become distressed. Only move to a busier setting in small steps. Never leave a dog alone in a parked vehicle during practice, temperatures can become dangerous quickly.
If your dog drools, vomits, trembles, or refuses to enter the car, the problem might include motion sickness or fear of the vehicle itself. Talk to your veterinarian before adding more trips. You may need to work on simply approaching and sitting in a stationary car before training around pedestrians.
A quieter ride is not about winning a battle with a window. It is about giving your dog a journey they can cope with and leaving the driver free to drive. For more on managing reactions to people passing close by, see the barking and reactivity guide, car restraint and safe driving take priority
Sources: Dogs Trust: How to train your dog to travel in the car. Dogs Trust: Reactive dogs - why it happens and how to help.