Adolfo13
I am not a lawyer and you should not take this as legal advice, but the answer to your question is likely both yes and no. If someone writes a fanfic, they cannot make any money off of it. This is because they do not own the copyright to the characters, world, etc. If somebody was to profit off a fanfic then legal action against that person would be much more likely.
Most fanfics make no money. Technically, the copyright owner could issue a DMCA to have it taken down anyways, but it would be very unlikely to happen. There are tons of naruto, DBZ, harry potter, etc. fanfics. Since they don't make money and the fans like them, there isn't really a good reason for the copyright holder to issue a DMCA. However, it can still happen. Pokemon/Nintendo seems to be more strict in protecting their copyrights. Like when they took down that popular pokemon parody YouTube video years ago, even though that one should have fell under fair use laws. Likewise, Disney might go to extremes to protect Mickey Mouse since he's their most important character.
That just leaves the question of fair use. For example, I have a character in my novel that is an obvious parody of Saitama from One Punch Man. I even named him Tama Sai. However, his personality is completely different as are his powers. Technically, the copyright holder of One Punch Man could try to get my novel taken down because of this despite it clearly falling under fair use law (USA). At that point it would likely depend on the platform to defend me. A bad platform like YouTube would likely just listen to the bigger dog and take it down. Fair use is a heavily debated topic and the little guys often get screwed. Especially since they can't afford legal fees if a lawsuit ever really does happen.