This is the first time that I've heard the claim that it is illegal to make yourself sick, and I've worked in the field of employee law in Germany for several years. I sincerely doubt that claim.
The relevant law is the EntgFG (Entgeltfortzahlungsgesetz), §3 - https://www.gesetze-im-internet.de/entgfg/__3.html where it says:
(1) Wird ein Arbeitnehmer durch Arbeitsunfähigkeit infolge Krankheit
an seiner Arbeitsleistung verhindert, ohne daß ihn ein Verschulden
The interesting part for your question is "ohne dass ihn ein Verschulden trifft" (without him being guilty). The courts clearly say here that this excludes only "grobe Fahrlässigkeit", i.e. when you are almost intentionally hurting yourself, e.g.:
Here is a text explaining a couple reasons that lead or don't lead to this:
In general, especially risky sports and getting yourself into a fight for no good reason (especially starting it) count for this.
That still doesn't make it illegal! It just means that your employer can refuse to continue paying your salary for the duration of your self-inflicted illness.
Does spicing up your food too much count as "grober Verstoss den ein verständiger Mensch nicht begehen würde" ? Well, if you completely emptied the pepper box on the pizza, probably yes. If you just added a bit too much spice - who hasn't done that? Is that in the same category as a sport that is so risky that even trained people and professionals are at a serious risk of injury? I don't think it is, but IANAL.