Another possibility is that Draco Malfoy himself gives the manor to Hermione. After seeing the error of his ways and realizing Hermione's great character, he decides to make amends in a grand way. He might feel that Hermione could put the manor to better use, perhaps for the benefit of the wizarding community at large, like turning it into a school for underprivileged young wizards.
It could also be a result of a magical bargain or curse gone wrong for the Malfoys. Suppose there was a powerful dark magic object in the manor that got out of control. Hermione, with her vast knowledge of magic, manages to contain it. In the process, she ends up being the rightful owner according to some ancient magic laws. This would make for an interesting plot twist in the fanfiction.
Perhaps they are there to rescue someone. Hermione might come up with a clever plan involving potions and charms to get past the manor's defenses. Ron, with his loyalty and determination, would be right by her side, ready to take on any danger that comes their way.
In some fanfictions, Ron and Hermione could be at Malfoy Manor for a diplomatic mission of sorts. The wizarding world is in chaos, and they are sent to try and convince the Malfoys to switch sides. This would be a very difficult task as the Malfoys have long been associated with the dark side. But Ron's loyalty and Hermione's persuasion skills could potentially make a difference.
Another way could be through a potion gone wrong. In the wizarding world, potions can have all sorts of strange effects. If Draco was trying to brew a potion for some other purpose, like trying to gain an advantage in a competition or something, and made a mistake in the ingredients or the brewing process, it could result in him being transformed into Hermione. This would force him to experience life from her perspective, which could be a huge character - development opportunity for him.
In some fanfictions, Hermione might find out she is a Malfoy due to a spell gone wrong. For example, a spell that was meant to reveal family lineages got mixed up and suddenly she has a connection to the Malfoy family in the magical world created by the fanfiction writer. It could also be a result of a hidden prophecy that links her to the Malfoys in an unexpected way.
In fanfiction, Harry staying at Malfoy Manor could lead to some unexpected alliances. He could end up befriending a house - elf there who helps him in his stay. This house - elf might know secret passages in the manor that Harry can use to his advantage. Or, Harry could even find a way to turn Draco Malfoy to his side during his stay, which would be a huge shift in the power dynamics considering Draco's family's loyalty to Voldemort.
It could be that in the manor, they discover they have more in common than they thought. Both are under a great deal of pressure - Draco to please his family and uphold the Malfoy name, and Hermione to fight against the Dark forces. As they interact more, they begin to understand each other's struggles, and this understanding leads to a deeper connection. Maybe they start to communicate without words, just by looks, as they plan their next move to survive or escape the manor.
Well, at the school reunion, Hermione and Malfoy might have an awkward encounter. Maybe they would finally bury the hatchet and start a friendly conversation about their past rivalries at school. They could even share a laugh about some of the silly things they did back then.
Well, one scenario could be that they are attending a peace - making event. Hermione, being the diplomat, tries to make amends between the Weasleys and the Malfoys, and Ron is there just to support her and make sure she doesn't get into any trouble. But things quickly go awry as old rivalries resurface.
There are several motives. Firstly, to add a sense of tragedy. The 'Harry Potter' series has its share of losses, but Hermione's death in a fanfic at Malfoy Manor would be a new level of tragedy. It could also be to rewrite the story in a more 'grimdark' style. This would attract readers who are interested in seeing a different side of the wizarding world. Moreover, it might be an attempt to explore the consequences of a major character's death on the overall plot. For example, how would the fight against Voldemort be different without Hermione's intelligence and magic skills?
Ron could become more confident in his relationship with Hermione. After seeing her in such a dangerous situation at Malfoy Manor, he realizes how much she means to him and is more assertive about his feelings. He might also grow in his magical abilities as he wants to be better able to protect her.