Perhaps in certain places during the Doomsday Era, there's still the ability to make such exquisite desserts.
For instance, the Evangelical Institute that Mazao mentioned before, which is reportedly the only organization during the Doomsday Era considered a major force, and Mazao used to be a member of it. Maybe there, compared to other barren places, there are richer resources and techniques, making it relatively easy to gather ingredients like eggs, milk, flour, and sugar.
There's also another possibility that Mazao's knowledge of making custard is not from the Doomsday Era, but from the "original Mazao"—the original owner of the body Mazao is currently using.
Or if Mazao's soul traveled from the modern world to the Doomsday Era and then returned, such knowledge might come from "Mazao before crossing over to the Doomsday Era," in which case Mazao and the original owner of the body are the same person to begin with.