I'm not really talking about just letting children open fifty loot boxes back to back. the kid doesn't necessarily understand they are losing in that scenario.
I'm thinking more about games like roulette, poker, dice with chores money. maybe it would need to be in a more controlled environment, like family game night.
not exactly gambling, but I learned a great lesson from my father this way when I was about eleven or twelve. I really wanted some expensive Lego so I begged my dad to lend money to purchase it. at first he wouldn't do it, but eventually he decided it might be a good learning experience for me. I had a blast playing with that set for a month or two, but after a while it was just one more toy that I owned. it took a lot longer than that to pay him back, so I had ample time to reflect on how much it sucked to be in debt. I never asked my dad for another toy loan, and I've basically never considered borrowing money again for anything other than college.