if he is teething the gums around the new teeth can become discolored from bruising as they chew to help bring in the new teeth. although this doesn't happen in all breeds it does happen in some. my lab's gum did bruise when she was teething, my pits didn't. i would ask another vet for their opinion.
Make sure he didnt eat anything blue by accident, if he didnt eat anything blue. Then take him to a different vet, their may be bad circulation to his mouth resulting in blue colored gums. Take your pup to a different vet tomorrow and have your pup stay with you tonight, so you can keep an eye on him.
Some dogs do develop pigmentation on their gums as they grow older. It is usually dark brown to black. What shade of blue is it? It could indicate an injury where the tissues are not getting enough oxygen. If your vet says it's fine, I would generally trust their opinion over people on the internet who have not even seen your dog.