Yes, but I would wait to decorate it until day-of because the color from the M&M's on top will start to bleed into the white frosting after sitting for a while. I'd instead suggest wrapping the baked cookie in saran wrap then waiting to frost until day-of. This cookie cake is best when eaten within 2-3 days. It can technically last longer than that, but it will start getting a dry texture. If you do make & frost it ahead: Because of the sugar content, you don't need to refrigerate the frosted cookie cake if you plan to enjoy it within 1 day.