It could be that your son is going through a phase in which he begins to wonder about dogs (in this case). Lots of things go on in that little mind! He knows there are many different dogs, not just his grandparents' wonderful dog; but some are startlingly noisy and some are quiet, some are startlingly bouncy and some are easygoing, some look as if they MIGHT be unfriendly and some don't. So he's being over-cautious.
Don't respond as if your son were at fault somehow. Go ahead and pick him up, remind him that some dogs are very nice, and suggest that he smile at the dog (from that safe height in your arms) and maybe say hello. He doesn't need to touch the dog unless he wants to and you allow it. Encourage him not to make a big noise at the dog (shrieking or crying).
My older granddaughters live in a home with a cat but no dog, and they viewed our bouncy puppies with disdain (read: fear) when they were that age. It took them a while to get over it. It definitely helped that they grew taller!