01 - Preheat oven to 400°F (200°C). Lightly grease a baking dish large enough to fit the cod fillets in a single layer.
02 - Pat the cod fillets dry and season both sides with salt and pepper. Drizzle with 1 tablespoon olive oil.
03 - Heat 2 tablespoons olive oil in a medium saucepan over medium heat. Add finely chopped onion and sauté until soft and translucent, about 4 minutes.
04 - Stir in minced garlic and cook for 1 minute until fragrant.
05 - Incorporate crushed tomatoes, tomato paste, sugar, oregano, red pepper flakes if using, salt, and pepper. Bring to a simmer and cook for 8 to 10 minutes, stirring occasionally, until the sauce thickens slightly.
06 - Remove the sauce from heat and stir in chopped fresh basil.
07 - Spread half of the tomato basil sauce on the bottom of the prepared baking dish. Arrange the cod fillets evenly over the sauce, then spoon the remaining sauce atop the fillets.
08 - Bake in the preheated oven for 15 to 18 minutes, or until the fish is opaque and flakes easily with a fork.
09 - Sprinkle fresh basil leaves over the baked cod and serve with optional lemon wedges.