At four, understanding the difference between reality and fiction is a work in progress. Research has shown that children may begin to learn that difference by four, using the context in which the information is presented to help differentiate between the two. However, this ability isn't fully developed by four. Each child is different here, and some will be much more able to differentiate than others (my older child was able to watch "scary" movies by five or so, while my seven year old still doesn't like to, in part because of this).
Additionally, one major concern you should pay attention to is that scary content can lead to nightmares in children around that age. The ability to differentiate fantasy from reality was shown to be relevant here as well.
How you can help your children understand the differences between fantasy and reality is by talking to them about it in those terms. Make it clear to them what "acting" is, perhaps even with role play games where they "act" in plays themselves. Talk about the actor as a person separate from their role - look them up on IMDB, show the person has done various different shows. This even works with cartoons, if the actor's voice is reasonably distinctive.
Talk about why the action is occurring, as well. I tend to avoid describing people as "bad" or "good", even in the case of actors playing what we traditionally would call "bad guys", because I don't want my children to think that some people are "bad people" - rather focusing on bad behaviors. So instead, talk about the motivation of the person, and how the behavior is not nice and has negative impacts on others. For the most part even at four I think this tends to be fairly easily understood.
My bigger concern is actually the "good guy". Batman is a great example of this (and of course, he's not truly a "good guy", but that's more complex than is intended in the cartoons). He hits the bad guys when they do bad things. That's not exactly a lesson I want my children learning! I want them to get Mom or Dad if someone is doing something bad. I want them to walk away from fights. So, I would tend to talk to them about other alternatives they might have in a similar situation. What do we do if we see a robber? We call the police, because we're not Batman! What do we do if someone hits us? We remove ourselves from the situation and tell an adult, because it's not nice to hit people even if they're not being nice to us.