It will always be ok to not take the reading opposite a stamped number.
It might be ok to take the reading opposite the stamped number in some cases, depending on:
The material.
The thickness of the material.
The size and depth of the stamping.
Probably so other things.
The concern is likely that stamping might work-harden the material "around" the stamp, and around could include the opposite surface.
In this particular case, assuming the stamp is done before the heat treat, probably it doesn't matter.
As a matter of simplicity, what you were taught is the way to go.