
Its was quite common back in the day. You could be "adopted" into a branch noble family. Often aristocrats would inherit noble families but have the following problems: 1. no direct descendants 2. have an heir but high debts. Wealthy merchant/middle-class families would pay a hefty sum of money to gain a nobles title (often with a portion of land or a business which would continue to bring money to the destitute aristocrat). But even without it, for a Duke this would be easy. Most nobles would love to tie their family to a Dukedom, hence there would be no limit on offers of "adopting a daughter" especially when that "daughter" will become the Duchess. Of course, both male heads of families would make the decision, and then suddenly XX Baron had a sickly daughter who was kept hidden and worked as a maid for fear of her life since she was promised to the duke at a young age blah blah blah. The XX Baron family gets prestige of having a Duke as a son-in-law (and potentially a down payment & also the Duke would give them the generous Dowry that they would supply to him during the time of marriage) . Its would be a huge win for the aristocratic family and they would keep this secret with their lives as forgery of "noble" status is a serious crime.
Buying her a noble title. Wtaf