My wife and I have a Corgi, who is about 9 months old. He is fixed. He gets along with other dogs in general, besides when being picked up by us in close proximity to another dog and sometimes when on leash. I'm not sure if he's doing it out of fear or protectiveness.
Another instance, which is similar, is when on leash around children, especially children on bikes. However, we previously had him around one of our friend's kids and they were like best friends while on leash. The child never did anything to upset him and they got along very well, which is what makes the situation confusing.
In my research I've found the children riding bikes and running around are pretty common for making dogs fearful or act out in this manner, so I'll approach this by distracting with treats from a distance when he initially becomes triggered from a distance, but before he acts out.
I'm not sure how to approach the times where we pick him up in front of other dogs. It's easily avoidable for visiting other dogs since we know this, but others who don't know this about him may catch a nasty surprise which I do not want happening.
Additionally, we are getting him a sister in a couple weeks since he is pretty high energy and loves running around with other dogs with every new dog he meets.
I think this is partially out of fear or anxiety, but I'm unsure as to why since we have had him since 8 weeks and visited him ever since he was born and nothing traumatic ever happened. It seems that he gets better and better as he gets older, but definitely don't want to rely on that and potentially have him get worse. Any suggestions would be great.