A 20 month old child is trying to explore the world, and this is important for his cognitive development. Hitting also can be a way of exploring. So you should not keep nagging the child to stop the exploration process, unless necessary.
At the same time, it is important to clarify limits and convey in a non-punitive way that some things are not to be touched or hit. Instead of punishing after an incident, try to predict from previous episodes to prevent any recurrence.Talk to the child and give explanations in clear language that the child can understand.