P.M.
Seeing some of the alarming responses to your request, I'm amending my response a bit.
R., you are not asking whether you should leave this marriage. But I hope you'll consider it as one valid option. Your son has very limited life experience at 3 years, and his behavior suggests that he's a spirited kid with a great deal of anger toward his father's personal "behavior."
I grew up in a household with an ultra-controlling and punitive mother who really, REALLY, didn't have a clue that her three daughters had emotional needs that might be different from hers. My second sister sounds a lot like your son - willing to risk parental wrath to express unmet needs and protest our mom's crushing, authoritarian stance. And she did receive Mom's wrath, more or less constantly, for 18 years. She didn't buckle under it like us other two girls. Life at home was hellish. All of us ended up seriously messed up. I am still working to heal emotional wounds, but I have fared better than my sisters. (There was eventually a 4th sis, who was spared the worst of the pressure, but she thought our mom's sternness was counterproductive and hurtful, too.)
I have surprisingly clear memories of my childhood misery starting about age 3 1/2. I hated my mother passionately, and still wish I could love her more (I'm sure she was doing what she thought was right, based on some very old-fashioned notions).
Children that age certainly are beginning to understand consequences, but have very little impulse control. If they are happy, sad, or furious, they are really not yet able to mask the feelings. Your little boy is not planning to torment his parents, but when the opportunity presents itself to express bottled-up hurt, he'll take it. I expect he's simply responding in the only immediate ways he knows to express his dismay, and in a manner that has been modeled for him; you don't like what someone does, you take it out on them physically.
I hope you won't allow your husband to break his spirit. Kids can (usually) be "made" to behave by parents overpowering them, but that doesn't meet their legitimate, essential needs for communication, fairness, understanding and consistency, not to mention love.
Tender, respectful, patient and consistent behavior toward children is the main predictor of whether they will learn to behave in tender, respectful and patient ways toward others, and consistently manage their impulses. I've seen it over and over. And I've seen almost miraculous behavior changes in children who are lucky enough to find an adult who treats them that way, even if their parents don't. At least their behavior changes toward the adults who treat them like they respect them.
I put up with moods much like what you describe for many years from my first husband - he was emotionally abusive to me, and eventually also physically rough toward my daughter. I might have tolerated it for many more years, but I began to notice that my daughter always got quiet, anxious, and very small when her dad was around (she was normally a cheerful little girl). One time, he actually locked her out of the house and told her to go live somewhere else. She was sobbing in confusion and terror when I got home from work a couple of hours later.
It became clear after an additional year of "counseling" that my husband had no intention of changing. I left the marriage, with no financial resources except for a low-paying job. I should have left sooner. I still feel pangs when I remember how my sweet little girl suffered in silent fear. She had considerable healing to do, as did I. Took a long time to realize we didn't "deserve" to be treated so harshly.
Your husband is quit possibly mirroring the kind of parenting he had. That is sad, but it's no excuse.
Megan said everything I would have wanted to say to you about taking care of yourself and your little boy. Your instincts are telling you that this is a very big problem. And your son may well internalize what is happening to him and pass it on to the next generation, unless you do something to stop it.
My best to you. I know that you are in a tough situation, whether you stay or consider leaving.