If you don't get any joy from the teacher, then see the head. The school has a duty to have (and implement!) an anti-bullying policy.
If your ds hits the other boy back, what is going to happen? Suppose he hits back a little too hard and lands the other boy in hospital? Would you be ok with that?
If he doesn't hit too hard, what is going to happen? Well, naturally, the other boy will hit him back a little harder? And sooner or later one of them will have a serious accident? How would you feel if your son, or the other boy, ended up seriously injured due to your advice?
It's not about sanctimoniousness- having myself attended a school where fighting was fairly rife, I couldn't help noticing that hitting back seldom solved the problem: it usually led to a full scale fight with lots of children involved and great potential for serious injuries.
My dcs have gone to schools where no hitting is allowed under any pretext. All the children are taught from reception that they must look out for each other and find a responsible adult if any other child is hurt or frightened or upset. Anyone who hits or hurts another child gets instant detention. At junior level you get excluded for repeated hitting.
The result is that everybody knows that fighting is wrong and it is impossible to get street cred by being vicious. My ds was knocked down in junior's by a friend of his: the other children instantly interfered and pulled the boy off and someone got a teacher. The offender lost a week of playtime. He hasn't done it again.
The school has some of the lowest levels of bullying in town.
This is what your school should be doing - and this is what you should tell them they ought to be doing.