Prince Harry working in the USA?

That’s not a good test case, because under German law titles of nobility have been converted into last names and are treated as such. So it is beyond doubt that if Franz were to marry, his spouse (heterosexual or homosexual) would be free to take on Franz’ family name just like any other marriage allows one spouse to take on the other’s name. Incidentally, this principle that the title is part of the last name also has the consequence that Franz’ name is Franz Herzog von Bayern, not Herzog Franz von Bayern.

(Originally, his last name was Prinz von Bayern, but upon his father’s death he legally changed it to Herzog von Bayern - this is a nod to the original way titles worked, and indicates that they still aren’t 100% ordinary last names. This can also be seen in the fact that unlike ordinary family names, a name that contains a former title of nobility gets inflected based on the gender - so if Franz were to marry a woman and she were to take his name, she’d be Herzogin von Bayern.)