Perhaps the fanfiction involves some plotlines that Luffy considers as betraying their crew's values, and Nami is somehow involved in those. Since Luffy values his crew highly, this could lead to a negative view of Nami in the fanfiction.
Maybe in that fanfiction, Nami's character is distorted in a way that Luffy, with his straightforward and honest nature, can't stand. For example, if she is portrayed as overly greedy or mean in a way that goes against the essence of her character in the original work.
It could be that the fanfiction creates some sort of conflict between Luffy and Nami that is not in line with their relationship in the original anime. Their relationship is based on friendship and mutual respect, and if the fanfiction violates this, Luffy might seem to 'hate' Nami in that context.
Perhaps Nami is under a curse. The curse makes her see Luffy as a threat, even though he's not. So, she ends up hurting him because she's compelled to by the dark magic of the curse until the crew can find a way to break it.
Luffy will most likely use his Gum - Gum abilities. He could stretch his arms to grab Nami and pull her away from the abuser quickly. For example, he might use Gum - Gum Pistol to knock out the bad guys who are abusing Nami.
In some fanfiction scenarios, if Nami were to side with an enemy, even if it was for a seemingly good reason like trying to protect the crew in a way that Luffy doesn't understand. Luffy has a strong sense of loyalty to his crew and seeing Nami on the 'opposing side' might enrage him. He might feel betrayed and his anger would be a natural reaction.
The theme of sacrifice could also play a part. Luffy might be willing to sacrifice his own goals or even put himself in danger to help Nami overcome her depression. Additionally, the theme of growth is likely. Nami could grow stronger emotionally as she overcomes her depression, and Luffy could grow in his understanding of complex emotions through this experience.
Hancock's charm could be a reason. She has a unique allure that might make Nami feel inferior. Maybe Hancock gets more attention from male characters.
Perhaps in the 'harry hates dunbledore fanfiction', Dumbledore is shown as being involved in some sort of secret plot that goes against Harry's values. For example, if Dumbledore was secretly working with the dark side in the fanfiction, Harry would naturally hate him. Also, it could be that Harry has discovered some long - hidden truth about Dumbledore that completely changes his view of him, like a past misdeed that Dumbledore has covered up.
One reason could be jealousy. Maybe Snape gets jealous of Lily's other relationships or her popularity at Hogwarts. Another could be a fundamental difference in their beliefs or values that grows over time into hatred.
Maybe in that fanfiction, McGonagall has some actions that Harry misinterprets. For example, she might be too strict with him in a way that he can't understand at that moment.
It could be due to a misunderstanding. In the fanfic, Remus might say or do something that Harry misinterprets as being against him. For example, Remus could be trying to protect Harry but his actions come across as controlling, which would make Harry dislike him and potentially hate him.
One reason could be a divergence from the original character traits. In the original story, Hermione and Ron have a complex relationship with love and friendship. Fanfiction that misrepresents Hermione's feelings towards Ron might go against the essence of her character. Maybe the fanfiction portrays her as hating Ron in a way that doesn't fit with her growth and development in the official series.