Along with the other helpful suggestions... what you might want to try is, enroll him in Gymboree classes or something like that. The "classes" are per age group. It is fun as well.... but maybe, in a formal setting, where OTHER kids are also following direction and "learning" and having fun... maybe your son, via indirect observation of the other kids, will follow the lead of others.
For some kids, these types of classes are like a "light-bulb" and then they realize... what is what, and what is just not acceptable, and what is.
It is like an introduction... to concepts, that a child this age, will and can learn... and he will be with other kids his same age, AND you have to be right there with your child in these classes. So you both learn....
Both my kids have taken Gymboree (and no I am not promoting this business), but they loved it and learned tons from it, casually and it is fun and kids love going there.
Also, as the others said... do NOT take him anywhere when he is (a) tired and has not napped (b) hungry (c) over stimulated already.... or over-tired. Because these things do NOT bode well for a child and it WILL make them like mini-monsters. Fussy and more fussy.
Hitting... is also a way of "stopping" whatever is going on... and this is the only way a young toddler knows how to cope sometimes. Hitting can also be a way for some kids to "shut-out" external stimuli and other kids/things that are irking them. Hitting can also be exploratory, per their development and it can also be a way to express frustration etc., blah blah blah.
So, you NEED to KNOW his cues... to know his body language and ANTICIPATE him and his moods. AND, do not take him to certain places... or you MUST follow him/shadow him closely.
AND, yes, kids this age DO NOT have any impulse control... it is not even fully-developed yet... and they cannot do things "at-will' much less consciously... but they can hit spontaneously. As you see. So it is the dichotomy of a Toddler. Their Cognition and their motor-skills/impulses are NOT congruent... in development, nor developed in tandem.
Regardless... if he is not napping... you should be having him nap. Everyday. Routinely. Lack of sleep... MAJORLY affects kids and their moods... it affects the the ability to cope and levels or patience in some people. Lack of sleep alone... can really be the main thing that is tweaking a child... or at least create a real big part of it, negatively.
As your son matures emotionally (emotions are NOT even fully developed at this age either), he will need to learn social skills. Which is what you need to teach him, and about his emotions. And how to express it. But for now... he perhaps, STILL DOES "parallel play" versus, interacting with other kids in a social way. THUS, when he is at a park with other kids.. .he does not know how to engage properly... so he hits. Its experimental... and other babies/kids are like "toys" to him.. .meaning he does not yet know how to "empathize" or understand what is bad or good, hurt or happy.
To me... he is still in that "parallel play" stage of development... and not fully onto the reciprocal social play of like with older kids. Thus, his reactions to other kids/you etc. He does NOT know how to handle himself yet. Nor understand. He is only 2... and 2 year olds "Parallel Play."
Do not expect much else of him... don't expect him to have social skills or know how to "make friends" like an older child.
**I recommend, you research "Parallel Play" or "how do 2 year olds play" etc.
all the best,