Yes, you can use foil in a toaster oven. However, you should exercise caution when using it.
You should remember that it is a fire hazard. There is also another problem, aluminum foil could be mixed in with food. The levels of leaching increase when food that is acidic is cooked in aluminum foil.