Your pup is just starting his adolescent phase, where it's very normal to become more interested in exploring his environment - including other dogs and people - independently and be less focused and (physically) attached to you. If he's intact, he'll also be getting a pretty big rush of hormones to deal with too, which may be part of his particular fascination with other dogs. If he's neutered, it's still a time of a lot of mental and physical changes and a notorious phase for dogs 'forgetting' cues and behavior they previously knew well, pushing boundaries to see what they can get away with, and blowing off their owners to do their own thing.
My solution to this if this were my dog is him losing off-leash privileges around other dogs for the time being. Work a lot on focus exercises and reminding your pup that interacting with you is fun and rewarding, even with other dogs around. Practice super easy recalls around other dogs, on a long line, to reinforce the behavior. If you have the ability to do so, find someone with a dog who's good with puppies who can do training sessions with you with their dog as a 'helper', so you have more control over how far away the other dog is when you're practicing, and when you feel ready to try letting the dogs have more contact you know it'll be safe for everyone.
Definitely don't allow your pup to continue this rude behavior with strange dogs. While most dogs allow young puppies to get away with silly and rude behavior, he's getting old enough that some dogs are going to start revoking this 'puppy license' and correcting him for his poor manners. While an occasional correction a good thing coming from a well-socialized dog who likes puppies and delivers fair, clear corrections, strange dogs may not be any or all of the above. They may have pain issues that make them grumpy, fear or anxiety around other dogs, have poor dog-dog social skills themselves, or just flat out not like puppies/be actively dog aggressive, so preventing the behavior is also protecting your pup from a possibly traumatizing interaction that will impact his behavior around other dogs for the rest of his life.