I've been bringing my dog to my new dog-friendly work place and noticed that he gets along with some dogs great like they're BFFs but with some others he growls and snaps at them almost within seconds. I thought at first he may just get along with females better since he may be trying to be the alpha male when another male is present, but he's snapped at and befriended with both genders, neutered/spayed or not. There's a female puppy at work whom he snapped and growled at right less than a minute into just meeting her, as well as another male dog. But he will play along with other dogs fine. It stresses me out since I never know if he's going to snap at the next dog he meets. If this persists (especially since the puppy is my boss's dog), I won't be able to bring him to work and having him alone at home doesn't help him socialize better.
I've had him since he was a puppy and he's always been great at dog parks, dog beaches and friends' homes. Any advice would be really appreciated!