Nothing wrong with a toddler having a treat, but I didn't let mine eat cake until she was 3 - I found it much easier to just not give her sweet treats than to have the argument about whether she was allowed it every time she wanted it, yk? So there's nothing wrong with waiting either, and I always found that she was perfectly happy to be given something else that she liked (a fruit bar or raisins) even when others were having cake.