OP - I think you have had a really rough time on here, and that there's a lot of unfair comments.
No, the teacher should not have said that to your son, and that would get my back up too. As you said, it's not his fault his Dad's a twat, and her comment was unprofessional and unfair on him. I had a similar Dad, and have had similar comments about his twattishness all my life from various people all my life, including when I was at school.
But I agree with others - the main problem here is your husband, and I can't help wondering whether your (slight) overreaction to her comment is a result of the underreaction you seem to apply to his shitty behaviour ( although I can see why you don't want to confront him as he appears unable to compromise, or more important, CARE that his attitude is causing grief for you and your DS). I mean, there are two people here who have been unreasonable but only one is being confronted, and I'm wondering if some of the anger you should be directing at DH is going to the teacher instead.
You say it's not your fault DH is a prick (a controlling, abusive and bullying one from what you've said). Very true. Then you say it's not your fault you're married to a twat. But actually - yeah, it sort of is. You choose to stay married despite his shitty behaviour and attitude, and whether it's fair or not you, and more importantly your DS WILL become tainted by association. Like it or not, people do judge others because the company they keep and the choices they make. This sort of this will keep cropping up and affecting you and your DS, and if I were you; I'd be having a long think about whether that's the way I'd want to be living my life, and the effect his appalling behaviour will be having on your DS. To him his Dad will be a role model and he is likely to mimic his Dads shitty attitude in the future, and he will then become 'that Dad' one day. Is that what you want for him?
I think maybe there are more problems in your marriage than you're letting on, and that the (rightful) anger you can't project at him is being misdirected.
You say you were separated at one point (and worryingly, his need for control during that time - more abusive behaviour) - if I were you I'd be questioning whether you made the right decision when you decided to reconcile. I think you'd both be better off away from this arsehole and his shitty behaviour. Getting and staying away wouldn't be easy by the sound the of it, but worth it, for both of you. Relationships should be based on mutual respect and compromise, and it sounds like you have scope for neither in your marriage.