but there was no punishment involved,
For most babies, the firm “no” will likely cause confusion, and they won’t necessarily connect it to touching a specific object. What does the parent do when the infant touches it after the “no”?
merely teaching the child that there are some things they can’t touch (which they can understand from a young age).
Please define young age – I was assuming we were discussing infants (e.g., < 12 months) here. I don’t believe that an infant can be effectively taught that there are some things they “can’t” touch (toy vs. not a toy); rather they learn to be afraid of certain things and people.
my two year old understands that she is not allowed to play with them
There is a universe of difference between an infant and a two year old. I agree that a two year old (who can climb and access far more objects than an infant, and say no!) should be instructed to not touch certain things. But, as you say, sometimes 2-year olds behave differently when hungry, tired, or sick. What should be done in those cases?
some of these kids are six, seven or eight years old
That sounds like a serious discipline issue, not a result of these children lacking the same objects in their house. A 6 to 8-year old child certainly is old enough to understand concepts like personal property, private and public, touch and don’t touch.