((eeny)) he is so little, I honestly wouldn't worry. Though I did, when dd1 went through a similar (brief) phase at around that age. I think some of it was purely experimental, and physical, rather than emotional - and some of it was frustration and no other way of expressing it yet.
The only other thought I had was tha tpossibly your DS has seen a child hit another child at nursery, it would be unusual if he hadn't, in fact - or in a playground, or somewhere.
dd1 got smacked in the face by an older boy at a playground once and was totally confused and upset by it: she did it to herself and me a couple of times after that and when she did, I said very firmly and clearly that I knew it had happened (I wasn't there), that it wasn't ok for anyone to hit dd, ever, and that Mummy was very cross with anyone who hit dd. THen I repeated simply 'we don't hit'.
She stood up in her cot (she was about 22 mos) and gave me a hug, and I think, I hope, she understood the gist of it all.
Whatever is going on with your ds, I am quite sure it will be put right with time and ongoing experience of lovely parents like yourself.
Hope you don't bash yourself, either