Hermione would probably be shocked at first. But then she would try to find a way to help Harry through it, using her vast knowledge of magic to figure out what's going on.
In fanfiction, the author often has the creative freedom to play with the rules. So, it could be that there is a new form of magic introduced that is unique to the Azkaban setting in this story. This new magic might have affected Harry in such a way that he becomes pregnant. It could also be related to the strange and often malevolent energy that surrounds Azkaban, which has some sort of mutagenic effect on him.
Harry might survive in Azkaban because of his connection to his friends, even if they betrayed him. Their memories could give him the strength to hold on. And he may be able to use his magic in unique ways. He could draw on the positive emotions he has left, like his love for his parents, to create a shield against the Dementors. Plus, he may be constantly looking for a way to prove his innocence and that hope could keep him alive.
He might use the invisibility cloak. Harry could sneak into Azkaban unnoticed and then use magic to break Draco out of his cell. The cloak has served him well in the past, and it would be a simple yet effective way to get past the guards.
Maybe he uses some powerful magic spells that he has learned secretly. For example, the Patronus charm could be used to fend off the Dementors which are the main guards in Azkaban. He might also get some unexpected help from his friends or some mysterious characters within the fanfiction world.
It could be Sirius Black. Since he has his own experience with Azkaban, he might know some secrets about the place. He could return in some form within the fanfiction and assist Harry in his escape, maybe by leading him through some hidden tunnels or using some special skills he developed during his time in prison.
Well, in some fanfictions, Harry might use some hidden magic he discovers in Azkaban. Maybe he finds a way to turn the Dementors' power against Voldemort. Since Dementors can suck out a person's soul, Harry could somehow direct them towards Voldemort, weakening him enough to deliver the final blow.
In the fanfiction, the female Harry Potter might be sent to Azkaban as part of a plot by Voldemort to get rid of her. While in Azkaban, she discovers a hidden power within herself. It could be related to her connection with her mother or some ancient magic. She then starts to influence the other inmates with her positive energy, and they start to believe in her as a symbol of hope against Voldemort.
Well, it could be many reasons. Maybe there was a misunderstanding. Some dark magic might have been used to make his friends think he did something bad. Or perhaps a powerful enemy framed him by planting false evidence. It's hard to say exactly without more context from the fanfiction.