Research says that children as young as 4 years can understand irony or sarcasm.
Well, not only understand, they can make ironical / sarcastic statements too.
Ojas- Mamma, I want my toy
Mamma trying to avoid- where is your toy?
Ojas- sarcasm dipping- you don't know where toys are kept?
But evidently, potty humour is not their forte
Mamma- giggles at his serious expression while doing the job
Tejas- in serious tone- Laugh मत कारो
Or Ojas- Mamma, we should not say B for Buttocks in class.