The interaction of dogs is complcated, and not something we humans are privvy to, unfortunately.
Most dogs will be tiwtchy around other dogs when on a lead - they know that are not free to fight or flee, so they tend to 'get in first' by putting their aggression on the table from the off, in order hopefully to avoid a fight. Problem is, if the other dog is a similar pursuasion, someone has to back down, or there is a fight.
With regard to the Jack Russell - they are notoriously kamikaze in their attitude to bigger dogs, the bigger they come, the more a JR will take them on. If your dog is of a docile nature, he may have been upset by this, and rememebred it, which may make him nervous around other dogs.
Don't worry about problems in the vets - almost all dogs pick up on the 'freak-out' atmosphere and vibes in a vet's waiting room, so they all get twitchy and start asserting themselves because they are insecure, so behavious in a vet's can be discounted - almost all dogs don't like vets , and take out their fear and uncertainty on other dogs.
Sounds like your dog is nice natured, but any dog will turn if the circumstances are there. Try to make sure you stay calm when other dogs are near - he will pick up on your nervousness, and he may will attack to 'protect' you by instinct, so if you stay calm, he will too.