Here's a fun one. As Dave outlined above, the UK is very flexible with naming. I'll add that the UK is also extremely flexible on titles. Anyone can use any social title (Mr/Ms/Mx et al) if they want to without putting it on a legal document. However, you can make a legal document (referred to as a 'change of name deed' or a 'deed poll' to legally change your name. You can then use this in combination with ID containing your former name, such as a passport, to identify yourself under your new name.
(It is however common practice to put your changed title on a deed poll document if you are changing your gender and also your title. This doesn't have legal significance but it does help communicate your intent when you need to change both name and title with a given service).
I am a trans man, so I've done both of these things. However, making a deed poll (which unlike many legal documents doesn't require a professional witness or to be registered at an office - you just need you and two friends who don't live with you) and having it accepted are two different problems.
Most places I've had to show my deed poll to have accepted it, but a good portion of them don't. There's been the medical receptionist who asked if I had "been through the whole process" referring to my gender and wouldn't change how I was registered. I came back with my (name already changed) driver's license and pointed out that the DVLA had accepted my deed poll and they begrudgingly put it through. Then I went to the bank and asked to change my name, where the person assigned to help me looked up "deed poll" on Google Images, pointed at a wax seal, and told me that because my deed poll didn't have that particular styling that it wasn't a legal document. I was able to change my name with the bank another day after calling a complaints line, but it was an infuriating experience.
There have also been less totally frustrating situations with people who were kind and fact-checked their assumptions when asked to, like someone who did right-to-work for me and asked whether I had gotten a letter back when I'd done my deed poll and if I could show them it. It goes to show that not nearly enough offices have HR or reception staff that know what to do when presented with a photo ID document containing a former name and a deed poll - because it's the wording and contents of the document that make it valid and not the format, quick visual checks like how you might check a different form of ID don't work well.
P.S. It gets even messier when you throw in dual nationality. At the time of writing, I'm legally male across the pond and legally female in the UK. Fun?