I realise that when you don’t own dogs, or have a fear of them, then dogs running up and barking = aggressive. I know this because I used to be terrified of dogs. Then I got one, started to understand its body language and how dogs minds work, and realised that dogs running up and barking does not always = aggressive.
Unfortunately, if you don’t have a dog then you won’t be able to tell the difference between aggressive dogs and non-aggressive dogs. I’d say the latter will generally outnumber the former by a factor of at least 10:1.
I walk mine in the same areas that I cycle (sometimes with him, sometimes without), and if I see another cyclist I whistle to him, call him over and keep him close to me or sat next to me whist the cyclist passes. More often than not, they don’t slow down or even acknowledge it with a quick “thanks”, which is nice.
If I’m out on the bike alone and I see a dog running about, I’ll slow down and try to spot the owner. If the dog runs up to me barking, it’ll be because they don’t know what I am and are trying to ascertain whether I’m a threat to their owner, who they want to protect. By slowing down and saying hello to the dog in a friendly voice, I am identifying myself as a friend, and the dog almost always stops barking, wags its tail and comes for a pat. If I were to adopt an aggressive pose and become threatening, it will only serve to escalate the situation, and it’s never going to end well from there.
Dogs are pack animals at heart, who will defend their alpha (the owner) against anything they perceive to be a threat. Make yourself a threat and you can see where it will lead. Mine has been taught that bikes and their rider are not a threat, but he likes to play games with me when I’m on my bike. Someone who doesn’t know dogs would not immediately recognise what he does as playing, and would feel threatened, hence why I call him to me. If all other owners did the same, I think relationships between cyclists and dogs would be less strained.