There were 2 attempts at affiliating regiments in the British Army to counties the first was in the mid 1700's and was not at all successful as the Regiments recruited when and where the could find "Volunteers" and as far as I am aware the depot of the regiment could be located anywhere.
The second was during the Cardwell Reforms of the 1880's here the regiments were affiliated to a county (but not neccesarily the same one as in the 1700's affiliation) and the depot was located somewhere in that county. However the really close affiliation with the county was probably only with the reserve and territorial battalions the regular line battalions probably had a looser affiliation the county (until about the time of WWI).
Also it should be remembered that to a greater or lesser extent people could volunteer, depending on circumstances, to serve in any regiment they wished.
As regards officers, as they had to purchase their commissions financial and other considerations were probably more important ie whether the regiment was serving in the West Indies or was a popular regiment where buying a commission would be more expensive were probably more important than joining a regiment that was affiliated to the county in which you lived.