Aside from their heightened sense of smell, another reason why dogs may seem to dislike other dogs instantly can be from historical experience.
Conversely, dogs may take a liking to other dogs that remind them of a certain well-liked canine friend.
Your dog's behavior towards other dogs may also be about you.