He's upset when you tell him no. That's understandable. No one likes being told no, not even grownups. But instead of just saying no, getting hit, then reacting even more forcefully and telling him not to do that, I think you need some new strategies.
It's easy to think that a four year old should just know some other replacement behavior to fill in when they have a desire to hit or otherwise lash out in anger. But the truth is, they just haven't learned those desirable replacement behaviors yet.
I think you need to sit him down and have a talk with him. Tell him that no one likes being told no not even grownups. But that if you hit another grownup because you didn't like being told no, you'd get in big trouble the police would even come! So, you tell him, it's important for us to learn OTHER ways to deal with being disappointed and sad when we're told no.
Don't just tell him what not to do, tell him a few things he can do that will help him to express his frustrated feelings when he feels them. He's not yet old enough to teach him to delay acting on his frustration, unless he's quite emotionally advanced (and he sounds very much like a run of the mill kid his age in terms of emotional expression!). But here's where the hard part comes in, because it has to be something you can really live with, but that also genuinely lets him express frustration. I advise strongly against any kind of "punch pillows/stuffed animals" expression of frustration, because it's very hard for children at this age to really get why it's fine to do that but not punch a human being, and because you create a dopamine cycle in which punching becomes associated with pleasurable frustration release. Most parents also don't want to have their child think it's acceptable behavior to, say, sulk and pout as a result of being told 'no.'
So think of some alternatives that would be acceptable ways of expressing frustration in your house, things that you would be accepting of. Telling a child that being told "no" should result in "suck it up and deal, and don't complain" is ridiculous, it's expecting more emotional continence from a small child than most adults are capable of, yet plenty of adults do it anyway (not saying you're doing this, I just see it a lot). The ways you or I might express frustration in a healthy way say, by ranting to our best friend about how unfair our boss is being, or something aren't usually open to children. So you have to get creative, and it has to be something you think your child will personally find to be a somewhat satisfying expression of frustration. For some kids, this could be coloring a picture of how they feel. For others, it could be singing their "angry song," but of course, if that's the one you pick, you have to be okay with them singing it in public. Everything depends on your individual situation.