A Doll's House centers itself around perceptions and misconceptions. Nora is a capable woman but her potential is hidden behind the diminutive position she holds in the family. Her fondness for sweets, particularly macaroons, has various underlying inferences.
Obviously Nora likes sweets but she is battling the stereotype of being the "little woman" and it is her husband's insistence that she avoids them because they will ruin her teeth that, subconsciously, by eating them, she is regaining some of the power denied her. It seems frivolous to behave this way but Nora's character is built upon her subservience to her husband with whom she has
a relationship based on power and oppression
She is not his equal or his partner. It is also significant that it is sweets that she "steals" because it is typical of children to sneak sweets or snacks when parents are not looking - and to then deny the fact - so Nora actually perpetuates and contributes to Torvald's characterization of her. By behaving like a child she reinforces her diminutive position as his "little squirrel."
At the beginning of A Doll's House, Nora has basically swapped her position as a child in her father's house to a similar position in her husband's and does not appear to have grown or matured in to this position. Social responsibility demands that she leave her father's house and that is what she has done. In keeping with the standards of the time she effectively becomes her husband's possession.
For a woman to have to hide the fact that she enjoys sweets sets up the play and foreshadows what can be expected of her, despite her own personal sacrifices and potential to be so much more.