There are a lot wellknown parody games (Four Elements Trainer, Innocent Witches). Just look at the amount of Harry Potter parody games (mine is one too), Innocent Witched and Witch Trainer are rather famous on F95. The developers earn money and have been doing so for years. Companies simply don't care, since it would cost a lot of effort to go after a developer who makes parody games based on their IP.
However, one company who is known to even hunt down fangames is Nintendo (games made by fans out of passion for their IP, of which most don't make money). So I think that unless you're making a game with a Nintendo character, you should be alright. And even when a company comes after you, I believe they issue a warning to shutdown your game before they take more action (someone please correct me when I am wrong).