Yes, some dogs are put off by "brisk and determined" so if you trot briskly past they will run out barking then stop & turn around & go back home. That can work--IF you know the dogs will behave that way. That will not work with all dogs. Some will run in & go for the horse's legs--more common with riding horses I have found--with a cart and so a person so close to the horse's rear legs, some dogs will choose to go instead for the horse's head. And, some dogs will just go for the horse's head regardless. I've known of a couple instances where a rider has had her horse attacked by a dog that ran out & just went straight for the horse's muzzle.
Holding your horse's head & hollering for the dog owner to call off their dog works only if that owner is actually outside & within earshot. Here, that often isn't the case. Dogs are loose outside while owners are either in the house, oblivious to any sounds from outside, or not home.
A friend of mine was driving in her community this past fall. As she passed this one house the dog that was chained there lunged toward her, broke his chain, and came racing out at her. She jumped out of the cart & grabbed her horse's bridle and hung on for dear life while the dog attacked her horse. She said there was just no time to do anything--she wouldn't have had time to draw her knife nor even a gun, had she been carrying one--she could only hang on & try to not let the horse get away from her. Lucky for her the dog owner was home & did notice a problem, so came running out to get his dog off. When it was all over my friend, her horse & cart were in the ditch, the cart tipped over & the harness broken in a couple of spots. Dog owner was very apologetic and hauled the cart & harness home while my friend walked the horse home.
In this area we do have specific animal control laws, and an animal control officer, plus a police constable who is fairly willing to enforce animal control laws. If I wanted to drive out around the neighborhood & knew there is a problem dog, I would contact the owner & let them know that I intend to drive on the roads in the neighborhood, and suggest that they make sure their dog is contained so that it doesn't bother me, or anyone else. I would also remind them of what the laws have to say about dogs running at large and harassing livestock...and that certainly applies regardless if the horse is harassed in its pasture or while being driven or led down a public roadway...and I make it clear that I will make sure those laws are enforced...right down to a destruction order for their dog...if that dog does ever bother me and my horse. If necessary I also tell them just how much it is likely to cost them in restitution and vet bills if their dog does any actual harm to my horse. I have found if the part about the destruction order (which is provided for under provincial law) doesn't get their attention, the part about how expensive restitution could be usually does the trick.
I have tested neighborhood dogs by walking down the road past their place--for starters I walk past alone, and then once I see how the dog reacts I will go for another walk, taking a horse with me. In both cases I carry a stock whip, and will use it on the dog if I have to.