There's a concept of you "altering" your lunch such that it becomes dangerous or inedible but still leaving it out, e.g. in a fridge, where a reasonable person would assume that the lunch is edible. If you put rat poison in your lunch then throw it in the garbage, it's going to be harder to argue that you intentionally hurt that person who stole it. Even harder is if you put in a biohazard disposal bag.
There's the concept of the severity of the offense - poisoning someone is worse than stealing their lunch. Nobody is calling the cops because their lunch got stolen once.
There's intent. If you poison your lunch and put it back in the fridge, you're accepting there's a chance someone takes it. Can you prove someone intentionally took your lunch as opposed to accidentally taking it? You can accidentally take the wrong takeout container, even multiple times. You can't accidentally poison your own food.
The likelihood of getting in legal trouble, as well as the potential severity of the trouble, can vary widely depending on where, how, who and other surrounding context.
Sure you can, it's just off topic.
* put a warning wrap on your sandwich - danger - this sandwich may have laxatives added
* if your sandwiches continue to go missing, label them AND add laxatives
Legally, there's really not a way around it besides simply not doing that.
If you actually need a certain medication, and you absolutely must take it by putting it in your lunch, then I suppose you can feel free to explain that in a courtroom, but you should be reminded that perjury is a vey bad legal strategy and judges don't like to play games.