When you hear a dog bark you brain is not really hearing the dog bark. It is receiving electric signals from your ears which we can call codes. Then it tries to find a match from all the sounds you have stored in your code bank. Then the brain realizes that the code it received matches with the dog.
Another example is When you eat spicy food why do you think you get the burning sense? Its because spicy foods trick your tongue to send a code that there is a hot object on your tongue.