HI,
According to some study that I have done this is the general rule.
The post offices are organised as below in a hierarchical way
HEAD OFFICE Has a unique code
SUB OFFICE Has a unique code
BRANCH OFFICE - Does not have a Unique Inherits the Pincode of its sub office.
There are two more types of offices GPO which is a head office named separately
Experimental post offices below Branch offices which may be temporary or later promoted as branch office.
The location of these post offices does not have anything to do with other administrative divisions though it may match to some extent.
The hierarchy also may cross boundaries depending on other factors.