If it is a pastry brought into Japan, you should pay attention to Japan's food safety regulations and entry regulations. Knowing the relevant regulations in advance can avoid bringing food that is not allowed to enter the country or food that exceeds the allowable weight and avoid unnecessary trouble.
Generally speaking, you can bring cake gift boxes to Japan, but you should pay attention to the number and types of cakes that meet the relevant regulations.