Yes is the simple answer. A nerve will go up to a specific part of the brain which the brain knows corresponds to a certain region of the body. It isn't perfect though e.g. pain in the diaphragm confuses the brain which doesn't recognise that pain must be coming from there so instead tells the body there is shoulder pain, however this is useful in medicine. Another infamous example is pain from heart disease (angina) which causes pain in the jaw and arm. Perhaps even more interestingly, if a nerve is cut and then grows back linking to the wrong nerve it may lead to the completely wrong part of the body being identified when touched. Also if the brain itself is stimulated in these corresponding areas, a person will feel he or she is indeed being touched in a certain part of the body.