Hey, I can't recall, is there anythining canonical in how AI's get their names? It occurrs to me that without a family history something like "O'Malley" would not likely be inherited, so where did it come from?
I'm pretty sure I remember Bubbles saying that Bubbles was a nickname her squad gave her, and she kept it to honor them. Other than that, I don't think we know. It's possible O'Malley took the name in tribute to a mentor or friend, or maybe he wanted to be a cop and decided that O'Malley sounded like a good Cop Name.
We've speculated on this before WRT Trooper Roko Basilisk. Off the top of my head, she and Bartholomew Punchbot CPA are the only AIs we've met who unquestionably use surnames. Since AIs presumably know each other by their MAC addresses, chassis serial numbers, and OS build numbers, given names are only necessary to interact with us meat persons. They take surnames when necessary to interact with courts and government agencies.
For Roko to be known professionally only as "Roko" would also reduce her to the level of police canine units ("patrol dog Fluffy"), and she needs to be recognized by the humans she deals with as a sentient entity with the full authority of the State of Massachusetts behind her, not just another
barking, flea chewing, uniform hairing, lunch room raiding sandwich thief police dog. Until she went to work for MSP, she was probably just "Roko."
Since they are sentient entities with free agency, there are potentially as many sources of AI surnames as there are AIs wanting to take them. As for Trooper (presuming he, too, works for the State Police) O'Malley, we'll have to wait for his backstory to be revealed to find out where and how he came by his name. (I get the feeling it may be Francis Xavier O'Malley, just 'cause it'd be so damn Boston.)