The only thing that matters when letters go through the sorting system is your full 'postcode address' (which includes the house number).
So if you live at 23 Acacia Avenue, Sometown, Northshire, XY1 2AB, your address (as far as the sorting system is concerned) is simply 23XY12AB. It's those characters which are encoded onto the envelope by the optical character recognition software that attempts to read people's handwriting (or by the person who has to manually deal with anything that can't be machine read).
Either somebody has written 'SO22' so appallingly that the machine has picked it up as 'M24' or, possibly more likely, two envelopes have got jammed together in a sorting machine, so that the the code for one envelope has been imprinted onto the other one.
Once the incorrect code is on an envelope it automatically finds it way to the road associated with that code, without any further human intervention. The postie then has a pile of envelopes destined for Bloggs Road and is only required to look at the house number to complete the delivery.