Someone stubbing a toe, dropping something or not winning at a contest after bragging.
I've never seen it used for something serious in germany.
- You can ask me anything you want. I will grant it to you but give your neighbour twice as much.
to which the Pole answered:
- Please, God, gouge one of my eyes.
Pretty ambivalent, IMHO, if house burning could be punishment shrugged off as a very humbling tribute. I think it is very very unlikely that stuff like castration or even just flagalation had started out as a voluntary practice.
So, yeah. The way I know a similar joke in German: The two of you get two wishes and a lashing. What will it be? The first said, a pot of gold and please grease my back so it doesn't hurt so much. The other replied: Gimme the other dudes gold and bind him to my back.
Plenty of variation on that one and I probably misremember it as well.