The only guy I know who did this was a Japanese guy. There were no male children in his wife’s family, so he took their name in order to continue their family name. Surely a noble gesture, but not common in the west.
Empress Maria-Theresa Hapsburg married Charles of Lorraine. There were no males. The continued line became known as Hapsburg-Lorraine.