You can marinate cod overnight depending on the ingredients in the marinade. The risk is the marinade will break down the delicate texture of the fish.  Acidic marinades, such as those made with vinegar or citrus juice, can denature (and essentially "cook") the proteins in the fish. Too long and it will be mushy or tough. A good rule of thumb with acidic ingredients is to marinate cod for no more than 30 minutes to an hour. For this recipe, you could brush this flavor mixture onto the cod up to a day in advance because it does not contain acid. However, it is truly delicious without marinating it in advance, so file this under "quick weeknight recipe", take the win, and save the finicky advance prep for something else.