Yes, you can substitute olive oil for vegetable oil when baking a cake, but there are some considerations to keep in mind:
Flavor: Olive oil has a distinct flavor, which can be more pronounced than the neutral taste of vegetable oil. This can add a pleasant depth to certain types of cakes, especially those with citrus or nutty flavors. However, if the cake has a delicate or subtle taste, the strong flavor of olive oil might overpower the other ingredients.
Type of Olive Oil: There are different types of olive oil, such as extra virgin, virgin, and light olive oil. Extra virgin olive oil has the strongest flavor, while light olive oil has a milder taste. If you're using olive oil as a substitute for vegetable oil in a cake, you might want to consider using a milder variant like light olive oil, so it doesn't overwhelm the cake's taste.
Texture: Olive oil has a different texture compared to vegetable oil, which might affect the final texture of the cake. In some cases, using olive oil can result in a slightly denser or moister cake. To compensate for this, you could try reducing the amount of oil slightly or adding a bit more liquid to the batter (e.g., milk or water).
Color: Olive oil is darker in color compared to most vegetable oils, and using it might affect the color of the cake. This might not be an issue for chocolate cakes or other darker-colored cakes, but it could be noticeable in lighter-colored cakes.
Baking Temperature: If you're baking at a very high temperature, be cautious when using olive oil, as it has a lower smoke point than many vegetable oils. If the oven temperature is too high, the olive oil might start to smoke, which can negatively impact the cake's flavor.
In summary, you can substitute olive oil for vegetable oil in baking, but it's essential to consider the flavor, type of olive oil, texture, and baking temperature to ensure it complements the cake's overall taste and texture. If you're unsure about the substitution, you can do a small test batch before making a full cake.