Sometimes the young generations like betting. Not in the sense of money gambling, but more of a Truth or Dare.
Sometimes, the bets can be a bit extreme :) one friend of mine bet that if X likes Y, then Y has to be his girlfriend - in the other hand, if my friend lose, she has to find a boyfriend. XD.
Fairly large areas of the country are Muslim-majority, and gambling with money is not allowed in Islam. Of course, there are still enough non-Muslims (and Muslims that are less strict and more liberal) that money gambling does take place, but certainly in some areas it does seem to be considerably less common than it is in western countries.
More "dare"-like bets don't seem to be affected by that, though - as Jason's comment illustrates.
With a slightly different tack, it's probably also worth noting that the English phrase "if X, I'll eat my hat" is a very idiomatic phrase, and is (usually) not taken literally; but just means you think something is very unlikely. Actually physically eating a hat isn't expected (but occasionally some people do to really show humility).
I would assume that in Bahasa, this idiomatic meaning doesn't apply; and if someone said that, we would expect to have an actual hat being eaten.
Those silly sentences are half the fun of Duo Lingo. I've developed Head Canons about our silly little Owl friend from all of them.
He has a really weird paranoia towards ducks, he has been to Eldritch lands beyond human comprehension (and failed a few SAN save throws) and yet still is inclined to lose bets somehow. Duo is also a fan of internet memes.
This turns out to be an 'old' English expression that you might see in some movies... Lots of references around... Charles Dickens used it at least once. For example, see:
Indonesian doesn't have tenses. "Saya memakan topi saya" can be translated as "I have eaten my hat", "I ate my hat" "I eat my hat" "I am eating my hat" or "I will eat my hat" -- all depending on context. I think Duo switches it around sometimes, to alert people to that fact.
Sometimes words like sudah (already), belum (not yet) or akan (will be) are given for clarification.