My children are 5 and 2. First, they say something to the affect of "No" (that's not right, stop that, NO, whatever). Second, they tell the teacher. If it is a problem that happens regularly, stay away from that person. Third, try to remove yourself from the situation (play somewhere else, go to an adult, make them laugh, whatever. Fourth, physically defend yourself.
My 5 year old practices kung fu and his sifu teaches a lot of restraining, blocking, etc. He may be a little boy, but he can grab my wrist and twist to where I can't move and I know that he can handle himself without having to hit...but he's learned how to hit as well. He has NEVER had an altercation where he's had to hit yet, but he has had situations with bullies where he's blocked them. I was very proud of him when he was 4 and a bully was pushing children down left and right. He went to Joseph and Joe said "Hey! Don't do that!" and the bully looked at him, then went at my 1 year old son. I jumped up to go intervene, but Joseph stepped in front of his brother and said "Don't touch my baby brother" and the bully tried to step around him, but Joseph just stepped with him (still blocking the little one) and said "Don't touch my baby brother". The kid got mad and swung at Joseph several times, but Joseph blocked every one, in perfect defensive stance. I stopped and watched, and the bully got frustrated and left after he wasn't able to land a single punch. I was proud that he was not only able to verbally speak up for himself, and his little brother, but also defended himself physically. He will not hit someone unless it's real important to do so though. That, thankfully, hasn't come up. He knows that it is NOT ok to do kung fu unless he must. He knows he'd get in trouble for fighting just to fight. But if he's done the first 3 steps, then he must do the 4th and I'm confident that he's capable.
We saw a video a month or so ago where there was a soccer game not far from here and some girl tripped on another. The one that fell jumped up and just started pounding the other girl who was taken by surprise, punching, kicking, pulling hair, it was ridiculous. I showed it to Joseph and said "SERIOUSLY---if this ever happens to you, you beat them until they pee their pants, or until an adult can come to help stop it. DO NOT just lay there and take it like that". I made sure he understood. Martial Arts, if taught at a good school with a good teacher, is great at instilling confidence as well as teaching fighting skills, defensive techniques, and self discipline. I can't say enough about what it's done for my son (and, it's just fun for him---he really enjoys it).
As for your son's situation: YOU tell your teacher to start paying better attention because if it's happening regularly, it's not good enough! My son was in daycare 3 days a week and we removed him last year (he was 4) because he kept coming everyday with stories of this one child hitting, pushing, throwing rocks, etc. He said he told the kid to stop, but it was everyday. I went and spoke to the teacher about it once. It didn't stop. So I went and spoke to the administrator and the teacher together, and we watched on the playground. I asked about my son's behavior, is he taunting, is he teasing, is he trying to instigate something (they said no). I asked if he was just being ridiculously sensitive, but that wasn't the case either. Turned out, the kid wasn't even in Joseph's class but they played on the playground at different times. I said "OK, then how's this? They are not getting along, it's not working. He tells me stuff all the time, he's told you, I've already spoken to you about this before. If they're not in the same class and it's just playground stuff (twice a day) then I am requesting that you direct one or both of them to areas opposite each other. It shouldn't be hard to keep one child on one end of the playground and another elsewhere, and it was much better for 2 weeks. Then it went back to normal, and I removed my child from that daycare.