First, I don't know that one could legitimately argue that Hardy intends for what happens between Frank Troy and Fanny to be interpreted as revenge on Fanny's part. Fanny does not seek revenge. She tries on two attempts to meet with Troy--once to marry him and once to see him after he's married to Bathsheba--because she needs his help and because she's pregnant. She was not trying to blackmail him or obtain revenge for his jilting her. She and her infant child die before she would even have an opportunity to tell many people that he fathered her child. That being said, it is certainly poetic justice that Troy realizes what he has lost when Fanny dies, grieves over her death, loses Bathsheba when she suspects what has happened, and eventually is shot by Bathsheba's suitor. So, in that sense, readers could argue that the consequences of Troy's denying Fanny his hand in marriage are avenged through Fanny's death and the ensuing events.
Because Hardy writes from an Existential viewpoint, a more likely interpretation of what happens to Fanny and even to Troy is that it was their fate from the beginning of their lives to experience hardship--especially in Fanny's case because she does nothing to bring such horrid circumstances upon herself (a similar Hardy character is Tess from Tess of the D'urbervilles.