If Ophelia were in a similar social position to Hamlet, the entire story would change. First, Polonius would not be against the marriage at all because if Hamlet loved Ophelia and Ophelia loved Hamlet and there were no social restrictions imposed upon them, then they would very likely marry. He would love the idea of having a daughter who is the princess of Denmark, especially since he kisses up to the king already. If Polonius was not against the marriage, then there would be no reason to prove that his future son-in-law was mad, since that could deter the marriage. He would be more likely to prove that Hamlet is actually sane. Polonius would not die, at least not in the way he did, because there would be no reason for him to spy on Gertrude and Hamlet.
Laertes would also refrain from telling his sister to basically ignore the man she loves.
Without restrictions from her father and brother, Ophelia would be free to return the affection Hamlet sends her. Perhaps if Ophelia showed Hamlet more of the love he felt for her, it would soften his revenge-driven heart and show some compassion for the other characters.
It is more difficult to determine how Hamlet's behaviour towards Ophelia would change if she were closer to him in social rank. Hamlet's personality is multifaceted and although he never seems to care that she is from a lower class that he is, he does not feel restrained by any decorum around her. However, it is unlikely that Hamlet would have made such blatantly sexual remarks to her in front of their parents if she was a higher ranked woman. Although, with Hamlet's personality, especially the smart comments he made towards the king, it is problematical to...