It is legal as long as you don't have an outstanding loan on the vehicle, if your insurance company paid the claim, and you keep the car. Your insurance company has the right to drop coverage or reduce the amount of coverage. If you have a loan, in most states, the check has to be issued to the body shop directly or to you and the lienholder jointly.
Yes it is legal.
However ... should you get into another accident, previous unrepaired damage is NOT covered and can cause a problem with determing what is the additional damage from the second accident.
Neila222