Depends on the jurisdiction, for example Germany is pretty strict.
If A marries B, then either both keep their names, both will be A or both will be B or one or both will be A-B or B-A. No other outcomes are possible, and if one of them was B-C before then the kids can't be A-B-C.
https://en.wikipedia.org/wiki/Antonio_Villaraigosa