Since this was a park (I’m assuming ON LEASH area) you really need to work on avoiding other dogs. If you are going to be playing off leash, I highly suggest either being in an area with almost zero traffic, or really working on your dog recall so that you can recall him the moment you see another dog and leash him. Neither dog should’ve been off leash for the greeting, or on a 30 foot line. Unfortunately, this is the type of situation where avoidance is the best way to prevent this from happening.
It’s hard to control what people do, so with my dog I have learned to just avoid them as much as possible. If I’m playing fetch in a field, I’m super vigilant for other people and their dogs. I think when your dog gets older, you’ll see more people avoid you (it’s a GSD) so it gets easier. But for the time being, you have to really watch for people and their dogs. I have one of those “friendly unless challenged” dogs, and the last thing I ever allow is a long enough interaction for the other dog to challenge mine. My dog can snap in a split second…and I don’t need a person thinking my dog is mean/vicious when they see me playing off leash with him. So I just don’t allow extra-long greetings…if I’m walking by people, we just walk by like we’re going somewhere and not really in the mood to socialize. I guess I’ve realized by now that although 95% of dogs are fine to meet, there’s that 5% you don’t want to, and that 5% makes me not want to allow my dogs to meet all 100%.
By the way...grabbing my dog in that way, is a surefire way to get yourself bit. You really never know which dogs are either trained or wired to do that. That's why I always advocate not physically touching/hurting a strange dog.