just for ref you could have A company called ATB which has 3 branches in the uk so they have different codes
Steve, when you have the setup that you mention, then you have three ATB entries that must include the branch indicator somehow. But if you do that, YES you can have three branches with different codes if that is your goal.
The only thing you shouldn't do in that case is to have three different codes that ALL resolve to exactly the same company information and use them interchangeably.
That is because from your description the codes are being used like prime keys (maybe even ARE prime keys) and the rule is simple: The PK must uniquely identify or perhaps associate with whatever is being identified in the remainder of the record.
Stated another way, there is an EXPLICIT uniqueness relationship between the PK and the rest of the record. It SHOULD be a
two-way relationship in that; if you have ATB company (unqualified), you should always get the same exact choice of PK each time; and if you have the same PK each time, you must select the same record each time. This is a theoretical design-level issue that novices don't always understand. There is (or should be) a 1-to-1 relationship between a PK and the logical entity identified by that PK.
However, IF you have "ATB (Essex)", "ATB (London)", and "ATB (Brighton)" with three different PKs, one for each case, you would be doing exactly what you wanted AND NEEDED to do to keep things straight.
It would also be acceptable if your branch designation was a different field from the company name in that case. The point being that the RECORD shoudl be unique but it is OK for individual fields to match content of other records where applicable.
I should also clarify that this point is THEORETICAL. If in practice you had three records with three different PKs and the only other field was a text string containing "ATB" it would work - but something else down the road would go off the rails, like being unable to make a GROUP BY work exactly right, or having a SORT not keep things in a decent order. This advice is designed to prevent LATER catastrophes.
Hope that clarifies the issue of your question.