One way is through community guidelines. Fandom communities can establish clear rules that prohibit such harmful and inappropriate content. If fans see such fanfictions, they can report them to the relevant platforms or moderators.
Education within the fandom is also crucial. Promote positive writing and respectful portrayals of the characters. Encourage fans to focus on the positive aspects of the relationship between Murdoc and 2D, like their musical collaborations. By setting a good example with positive fanfictions, it can discourage those who might be inclined to write about abuse.