1. Position a rack in the upper third of the oven and preheat to 180 degree Celsius.
2. In a shallow 10-inch cast-iron pan or other flameproof pan over medium heat, warm the oil. Add the onion and garlic and cook, stirring, until translucent, 2 to 3 minutes. Add the bell pepper and cook, stirring, until beginning to soften, about 2 minutes. Stir in the tomatoes and cook until mixture forms a thick, juicy sauce. Set aside 1 tablespoon of the pimientos and add the rest to the sauce. Add 3 tablespoons of the sherry, stir to mix well and cook until heated through, about 2 minutes. Stir in 1 teaspoon salt and 1/2 teaspoon pepper.
3. To bake individually, transfer the tomato mixture to 4 shallow baking dishes, dividing evenly. Using the back of a large metal spoon, form 2 deep wells in the sauce. One at a time, break an egg into a small, shallow dish and then carefully slip into a well. Drizzle the eggs with the remaining 1 tablespoon sherry, sprinkle with a little more salt and pepper, and top each egg with a silver of butter and some reserved pimiento. Alternatively, bake the eggs in the pan with the tomato mixture, forming 8 wells in the tomato mixture, using the same method as above to slip the eggs into each of the wells.
4. Bake, uncovered, until the eggs are done to your liking, about 10 minutes for a runny yolk or 15 minutes for a hard-cooked yolk. Serve immediately.