I think it is necessary to do a work in the screen with the dog and to accustom it as soon as it is small to see horses all around him. After that you should not have a dog who is barking all the time or who does not respect the safety distances so as not to take a hit or scare the horse ...
During the apprenticeship, it is necessary to leave them as much as possible in walk together in the beginning in hand to reassure the two animals and to establish a place to each one. There really must be a bond of friendship that forges between the two animals. On the other hand, I think that we must always be vigilant and watch the place of the dogs and that they be trained to the way so that when we say a simple "right" or "left" the dog shifts.