At common law, which may no longer be the law in England, your name is what you and others use to refer to yourself.
So, even if person A was Christened "John Jacob Smith" at birth, while person B was Christened "James Bond" at birth, if person A lived his life as described using the name "James Bond", then "James Bond" would legally be one of Person A's names at common law.
But, even under that version of the law, doing something strictly as a consequence of impersonating someone else would usually be unlawful.
He lives his life, marries his girlfriend, lives with her, has sexual
relations with her. But she doesn't know she's with Person A instead
of the man she originally met, Person B.
There is a concept of impersonating a spouse for sex that can constitute rape but I don't think that it applies in this case, because the relationship development for the most part with person A. Particularly importantly, the girlfriend is having sex with the person she married, even if she previously dated someone whom she has confused with her current spouse. Now, if person B returned and tried to have sex with the girlfriend by pretending to be person B's imposter, that might very well be rape.
This said, it is very hard to imagine the girlfriend really couldn't tell the difference between person A and person B, because generally speaking, intimate friends of even identical twins can tell them apart. So, this premise is wildly improbable.
Person A is also practicing law in place of Person B. The licence is
in Person A's name, but Person B took the bar exam.
It sounds like Person A is practicing law without a license. This is definitely unlawful, although I don't know if it is actually a crime under English law as opposed, for example, to merely constituting a civil offense or contempt of court, or some form of civil fraud.