At 22 months, telling him "no" has very little effect on many children beyond teaching them to say no to everything during the Terrible Twos. They understand action and consistency. And at this age, they are natural scientists, experimenting with (and fascinated by) cause and effect. But they have pretty sketchy empathy, and so getting another child to cry is fascinating and powerful.
The most effective approach that's used in good preschools is to shadow a child who has a hurtful habit (this works for biting, for example). But a watchful adult has to be assigned to hover near the child, learn to identify the situation that leads up to the behavior, and to swoop in an intercept the child bodily, ideally just before the bite, hit, pinch or scratch happens. In your case, you should grasp the child's hand firmly but gently, and state something positive, like "Be gentle, please," and use that little hand to stroke the child he was about to hit. Then direct the child's attention back to a toy he can have.
This approach is demanding but effective. An adult may have to catch the child a couple of dozen times over a couple of weeks, but usually by then, the child is beginning to recognize that a behavior is not going to be tolerated, and can begin to catch himself.
Again, this takes consistent adult intervention. In a playgroup, the adult would be you. So if you want to give your son chances to interact, you'll need to monitor his behavior closely if you want him to continue to be welcome.
Another option would be to keep play dates limited for now. He's still in the "parallel play" stage, where he plays alongside others but doesn't interact with them much (beyond watching, grabbing and hitting, anyway). That stage gives way to interactive play in the next year or so. At that point, the centers in his brain that allow him to control and constrain his own behavior will be better developed, too, so he'll be able to remember rules better.