Yes, you can bake a cake in a toaster oven. However, it's important to note that the size and capacity of the toaster oven may limit the size of the cake you can bake. Use a small cake pan that fits comfortably inside the toaster oven and adjust the baking time accordingly. It's also recommended to use the convection setting if your toaster oven has one, as it helps with even baking.