That is correct. Parents might protect kids from something particular only at home. Then the kid goes outside and learns new things and learn them in the way street presents him. It makes sense to gamble in front of kids and if they show interest explain what gambling is. Explain its purpose in the way you want them to learn it. Not in a way a stranger explains them. I want my kids to learn that gambling is for entertainment, not, for example, a way to cheat drunk and naive people for easy money. I would better teach and play with my kid a game of shell just for fun, instead of him learning it himself on the street when being 18+ while gambling with sharper.
I think that gambling with a child is not a good idea. As you know, the result of gambling is highly dependent on chance. What will you do if your child is constantly lucky in gambling with you? Wouldn't he want to test his gambling skills with his peers? Personally, I think that gambling with children can develop an interest in risk and excitement, which in my opinion is not very good. On the other hand, I have been gambling since high school and I don't blame my parents for not being able to protect me from gambling. It's actually quite controversial.