The trick to teaching your dog how to balance something is teaching them "hold still" while holding their head firmly but gently. If they move and drop the item, no treat. If they hold still until you say ok, then they get a treat. (Note that this method made my dog very treat focused. She doesn’t hold still unless you are trying to balance a grape on her nose.)
What tricks does your dog know?
Photo by SuperFantastic.