Ds was around 17 or 18 months when he walked into the kitchen and went towards to fridge. I said "not for Bob" as I had been doing since he started crawling, and he looked really relieved, like he was glad that was still the rule and he understood it.
Deliberate, willfull naughtiness (just for the sake, rather than for another reason such as tired or ill) has only just started at nearly 3.
The main thing at any age is your reaction. If there isn't one the behaviour is not worth repeating.