Preheat the oven to 385°F. Line a rimmed baking sheet with parchment paper.
To make the mayo, cut the tomatoes in half and place them cut side down on the prepared baking sheet. Drizzle them with the oil and roast for 20–25 minutes, or until soft and wrinkly. Remove from the oven and let cool on the pan. Pulse the cooled tomatoes with the mayo in a food processor until well incorporated. Add a pinch of salt and pepper and set aside, covered, at room temperature.
To make the fritters, fill a large skillet or cast-iron Dutch oven with 1½ –2 inches of vegetable oil. Heat the oil to 370°F (a candy thermometer is ideal for this).
In a large bowl, stir together the cod, flour, onion, corn, cilantro, red pepper flakes, baking powder, and salt. Mixing vigorously with a wooden spoon, slowly add the water until the batter has the texture of Greek yogurt and is slightly bubbly throughout. You may not need all of the water.
Using two spoons and working in small batches, carefully place heaping tablespoonfuls of batter in the hot oil. Turn them when the undersides are a deep golden brown, 2–3 minutes per side. Drain on paper towels. Serve immediately with the mayo.
The mayo will keep in an airtight container in the fridge for up to 1 week but the fritters are best eaten the same day they’re made.