It's not just about direct learning, like "ooh badguy smoke I goodguy so I no smoke". It's about normalizing; creating a landscape of what should be expected that the public can internalize.
Once upon a time, cartoons featuring racist depictions of foreigners were commonplace. Not so much anymore. There was a time where a woman couldn't be the main character of a comic unless the point was to show off how sexy she was. Again, not so much anymore (kinda).
Is this because comics that displayed opposing views 'taught' us differently? In some cases, maybe, in most cases, no. It's just that as people began to think differently, they created media in line with their thinking that helped to change what was considered normal: the two areas of human knowledge, the social zeitgeist and the media landscape, sorta learn from each other.
That's how media teaches: not by convincing you that because the moral of the story is Viewpoint A, Viewpoint A must be absorbed into your brain. It's by showing you the validity of Viewpoint A (i.e. someone else believes it enough to write a story about it), and letting you sort it into either the Normal or Abnormal categories of human behavior in your brain.
You may not accept Viewpoint A just because you read a lot of it, but if reading a lot of it is compounded with other people reading a lot of Viewpoint A and touting the validity of Viewpoint A (or vice versa), all of that together is going to shape the way you think about Viewpoint A.
P.S. Honestly, now that I think about it, I'm taking this way too seriously. ^^; You can easily learn things from comics that have nothing to do with your outlook on the world, like a word in another language, or how to use a monkey wrench. The simple act of reading something created by someone who was not you opens up the possibility of learning something you didn't know before.