A typical passenger car would have two such motors, while a heavy-duty or high-performance vehicle could have a motor in each of its wheels.
So the question of how reliable braking is achieved is still open.
Directly connect the motor to a bank of resistors (maybe use the same system in an electric car that is used for AC anyway so you don't waste the heat) or into supercaps, and if you want really enormous braking power apply the power in reverse. You will need brakes though for the last few km/h and for parking brake.
I suspect you can only install these motors on the rear wheels so the front wheels can have normal brakes.
Megawatts of braking for 1 or 2 seconds is very much doable, if designed for that.
This really isn't a problem. A hub motor should have no problem providing more stopping force than the tire/road interface can manage.
Heat is no problem either. Either dump the excess energy into a battery or just design a motor housing that can cool itself well enough. You have way more area and mass in a hub motor than in a brake rotor. You'd almost have to try to screw it up.
Maximum stopping distance laws are a complete joke. Anything can stop fast the first time. It's the 5th, 6th, 7th time that's a problem. Electric motors actually have the advantage in that situation because they fade more linearly than a hydraulic system.
Brake rotors have less thermal mass, but can get red-hot without damage.
The fall-off on braking performance on worn tires is crazy bad.
A car can go without brakes in the rear, but front brakes are crucial in the front. This is specially true in emergency situations. I doubt an electric motor can provide enough braking power to stop any car at highway speeds in the distance required by most countries