I only take dogs out who know not to run under feet - Just to dangerous for horse and dog otherwise.
However, I often take one, two or three of our working Kelpies out with me for a run when there isn't much sheep work. My dog has been out with me a lot, but her mum Holly and the other bitch, Flash, haven't.
Holly is good - She sticks with my dog and just tags along out of the way. Flash however sometimes crosses in front and tries to bite the horses on the nose - Not fun!
When she does it, I growl at her and ride my horse forward at her to throw her jump off. It generally works pretty well and she drops back with the others.
If a dog is inclined to run underfoot, I would take a leadrope with leather poppers or a stockwhip, and give them a flick if they got in range of the horses feet. Just too dangerous.