Is it legal for an insurance company to have a totaled car repaired and give it back to the owner?

Is it legal for an insurance company to have a totaled car repaired and give it back to the owner?

Why does  insurance  increase?
"Will Our car  insurance  increase if your 16-year gets a 2door automobile