It may depend on the type of dog. If it was a terrier or collie type, their working instinct is to chase anything that moves. Hence why they chase bikes, cars, people etc.. Once they start to go after you, the chase is on! If it's really up for a fight, the best thing to do is to jump over a fence or wall that it can't get over. Not easy with a biggish dog....or if you're in the middle of nowhere. If that's the case, stop running and turn sideways on to the dog. Drop your shoulders, let your body go limp, stay quiet and walk slowly away. NEVER try to stare a dog out or use threatening body language with a dog in fight mode. If a dog is standing barking at you, stay quiet. Any noise you make will worsen the situation. In the worst case, if a dog is really attacking you and has you on the ground, curl up in a ball, protecting your face and 'play dead'. Without provocation, a dog will not stay in fight mode for long.
Dogs in true fight mode are scary. I know. I've dealt with many dog fights (from German Shepherds to Jack Russels) and have scarred dogs and vets bills to prove it. If you're going to put yourself in a situation where there's a chance of being out of control, make sure you know what to do. The same is true for horses, bulls, geese etc., as well as dogs. Different animals need different responses.
If this dog was in fight mode, the noise from your garmin could indeed have made things worse. It's worth bearing in mind. I do hope you're ok and that it hasn't put you off running.