There is also a complex lottery where the process begins with chance. This covers things like scratchcards where you choose which things to scratch off but which card you are given, and what is printed on the card is governed by chance.
http://www.legislation.gov.uk/ukpga/2005/19/section/14
Lotteries are one of 3 forms of gambling covered by this regulation, so in the uk at least it seems pretty obvious that lootboxes are gambling from a legal point of view. Lotteries are permitted for people older than 16 in the UK but it's an offence to allow a "child" (someone younger than 16 in this law) to participate (http://www.legislation.gov.uk/ukpga/2005/19/section/56)
It's also an offence if your company to manufacture, supply, install or adapt gambling software without a license. So they could be liable from that point of view also, in the UK at least.
edit: clarify one bit of wording
This part sounds leaky to me. Game producers might assign prizes which are based e.g. 99% on chance and 1% on skill.
You can (and at least two big companies do) make money from operating a lottery on behalf of a charity, but you can't run a lottery where the profits themselves go somewhere other than a "good cause" such as a charity. And the UK has tighter regulation than the US of charities so it's harder to have a "charity" that basically just puts money into your own pockets.
Also the rare skin itself can be the profit because you get a higher status and prestige within your peers.
That- and only that, is the acceptable gambling that i could accept existing.
You buy bonds, and like a lottery ticket they might randomly win a prize in a draw. But because it's a bank not a lottery the bonds themselves never go away if you don't win, it's basically a savings account except instead of boring percentage interest you randomly win prizes.
New stuff come with new rules, may sound more resealable.