you can try to tell your boy he needs to treat everyone nicely. hitting is not acceptable. tell him that you don't like it. i always use reward method to encourage my kid to do something or correct his behavior like take him to the park, give him some favourite snacks, stickers etc.
you may need to repeatedly remind and talk to him. it takes time and patience, but i think its important to teach him what are unacceptable behaviors at early age. don't give up!!!
one more thing, if your son is the only child in your family, i think u can set up playdate for him. Let him to play with other kids so that he has more chances to socialize with other kids and u can also monitor his behavior. if he acts in unacceptable manners, u can step in to correct his behaviors immediately...