Not only did your dog react fantastially (evidently you're a good handler and probably could own a horse - lol) but, you did pretty darn good, considering you have no horse experience.
"hhadavis" gave an excellent answer but, just to underline it:
I have four horses - four different personalities and opinions regarding trespassors in their personal space:
Three of the four would have either totally ignored you or two of them might have wandered slowly up to you to introduce themselves and say "got anything in your pockets?" The third, my Arab, wouldn't be caught dead "taking candy from a stranger".
The fourth, is the one I call the "Psychotic Intimidator". He is not the alpha-dominant over the herd but he IS the horse that keeps stray dogs out of the pasture. When dogs pack up, they can sometimes be fatal to livestock; often bringing down a weaker adult or a younger bovine or equine, mostly for sport.
This horse would have come at you at a fast walk, all the while "sensing" you out. If he sensed fear, he would seize that and start chasing you. If he didn't sense any fear, he would put himself right in your face, demanding to know who you are and by the way, where's the candy?
He would also pin his ears, snake his head, and go stomping toward your dog --- in heartbeat. If the dog stood it's ground, believe me there would be a battle between 1,150 lbs of horse and a dog
It's something I have always let him get away with because we live very rural and oftentimes have BIG dogs dumped off. I can't risk having dogs in the pasture that want to devil my horses into running thru a fence and/or dragging them down, so I let this horse get away with being that Psychotic Intimidator".
I hope I've helped explain that some horses are aggressive and some aren't.
Thanks for coming to a horse forum to ask what I feel is an important question.
You and your dog did great. I am sorry it was a bad horse experience for you but if you ever do change your mind and want to get into horses, it sounds as if you have the first and most important thing a horse owner needs:
Common Sense and a Sense of Responsibility