Yes, it is grammatically correct to say "inscription on a cake." This phrase typically refers to a message or writing that is decorated on the surface of a cake, often for special occasions like birthdays, weddings, or celebrations. The inscription can include names, dates, greetings, or any personalized message intended for the event.