Hello and welcome. This is just a short note to introduce myself or to request needed information for your problem. My name is ***** ***** I have been in the dog field for 25 years. I am a Therapy Dog & AKC Evaluator/trainer/ as well as an assistance/service dog trainer, specializing in behavior. It will be my pleasure to help you today.
You have to be able to catch a behavior in order to stop an incident. The first thing I would do is teach the dog a firm leave it command. When taught to 100% accuracy this is the command you would give to prevent the dog from going after the horse the moment you see it about to happen.
Once you get a firm leave it then keep the dog on leash and take him near the horse and if he seems interested give the leave it . With a leave it command the dog should put its attention back onto the owner and the moment he does praise and reward him. Right now he only knows one way to interact with the horse so the more you can praise and reward the behavior you want to see the more the dog will learn a different way to interact with the horse.
When you teach this command you want to start inside where there are no distractions then build up to more distractions slowly to be sure the dog understands. The reward in lower distracting areas can be dog treats, in higher distracting places use better food rewards such as hot dog pieces or chicken. Make sure to use a high value reward around the horse.
For times you are not out with the dog then it is best to keep the dog inside with you or build a large fenced in area specifically for the dog. If a kick from the horse has not stopped the behavior , the only way to keep the dog safe,is to prevent it from happening again.
The link below goes over how to teach a leave it command.