Good point, and when weapons are involved, people tend to focus on the weapon. Whether you’re the one with the weapon or not, overfocusing on it can leave you vulnerable to everything that you’re not paying attention to.
Many years ago, my keychain was a dog’s choke chain, probably about 24" long. One end had my keys on it, the other end had a padlock. It looked like a typical punk/biker wallet chain, but was convenient for locking things up and also could have functioned as a flail. A typical keychain though? No way.
First thing is not to run (unless you can get to a safer spot before the dog can get to you). Running is acting like prey and encouraging the dog to chase you. I used to carry beef jerky when I’d go walking and toss it as a distraction. Made friends with some strays that had initially had a hostile demeanor. But it’s certainly not guaranteed. I also had some success with just barking back and trying to look intimidating, but that may make some dogs more aggressive. Just standing still, not making eye contact, and looking boring/non-threatening and not afraid may cause them to lose interest if they think they’re defending, but maybe not if they’re actually on the attack.
This page describes what I was taught to do if actually getting bitten: (possible trigger warning) http://www.fightingarts.com/reading/article.php?id=337 but luckily it never actually came to that. I only got two minor bites (neither were enough to break skin) and both times the dogs looked surprised and stopped after that one bite. What scares me is packs. Dogs get mob mentality just like humans.