Yes, Just as Rhiannon and Binza have said, I'm sure he'll grow out of it and I echo their advice. I've had a boy who was lovely one minute, and a hitter the next. By the time he was 6, he had grown out of hitting. too. But it's not easy having to cope with both the parents and other children's reactions to your son's behaviour, is it? You just have to keep on watching and apologising.
On another message thread, someone gave some very useful advice on behavour: Every time he hits out, as well as punishing him, tell him to 'use his words' and keep reinforcing how to behave as well as how not to. And, as a practical tip, advised cutting his nails very regularly to minimise the risk of scratching another.
I suppose your son is a bit young for this at the moment, but it might be worth bearing in mind if the hitting continues. As a young toddler my son tended to hit when he was tired or over-excited, by the way. Big groups, like birthday parties, often saw him at his worst. Perhaps you could avoid some of these, and concentrate on more peaceful gatherings for a while. Though I have to admit I didn't do this. I just gritted my teeth and took him along.
My son grew out of hitting girls first - age 3 to 4. His early toddler hitting tended to merge into play fights with boys. Then the hitting aspect gradually diminished from 4 to 6 years to be replaced by other things - perhaps because he got fed up with missing so many school playtimes. I know he hated it when this happened - a little self interest works wonders.