The anime is a different incarnation of pokemon aside from the video games, and should be treated as such.
Immunities like that are in the show, but if you get too deep into the mechanics, it makes it difficult for casual viewers to keep up; it wouldn't make as much sense if you don't play the games. The TV show has no levels, it has no EVs, no Ivs, none of that; it depends on the pokemon itself.
There is an instance towards the beginning of the series after losing to Brock where Ash, with the help of Flint, had pikachu supercharged via waterwheel to give it a bit more power. If Ash's Pikachu is stronger than the average pikachu, then that could account for it. Just because a pokemon has a type immunity doesn't mean it will be completely impervious to it on the show, just like how a super effective move won't always take it down easily.
The show and the games are two different things as said earlier, besides, there isn't much to be realistic in a show about animals with superpowers being tamed by children and forced into cockfights.