That depends. Did you use Front Loader detergent in a top loader, or Top Loader detergent in the front loader?
Front loader detergent in a top loader may mean your clothes don’t necessarily get the best clean, but nothing disastrous should take place.
As for the other case, top loader detergent is engineered to foam, as there’s usually plenty of room in a top-loader drum for the suds to expand and soak through the laundry.
If you’ve used top loader detergent in your front loader, stop the cycle if possible, and set the appliance to drain. The door won’t open until the drum is empty of water. If for any reason it’s not possible to stop and drain the machine, see if you can switch over to a shorter cycle to minimise soap build-up.
NB: High-Efficiency (HE) top loaders are designed to work with low-foaming detergents, so be careful which detergents you use here.