You can absolutely do that, and people do it for different reasons.
Save money on co2
No more room in the kegarator
Etc
A few things to take into consideration is that you may still want to purge the keg with co2 to remove most of the o2 and also most kegs seal up better with some pressure in them. Also the amount of sugar needed to prime will be less when you prime in the keg rather than bottles. There are online calculators that all of this into account.
Lastly you will be left with yeast in the bottom of the keg just like in the bottom of a bottle conditioned beer. Thats not a huge deal but something to think about. Either the first pour or 2 will be muddy or you can shorten your dip tube.
Very lastly, your keg will not explode unless you have removed or modified your PRV (pressure release valve) Most kegs I have seen are rated to 100psi but the spring in the prv is so old they often open well before that. It's actually not a bad idea to test your PRV every once in a while, and it's easy enough to do, when you purge the keg just turn your regulator up slowly until the PRV starts relieving pressure. Be sure to check the pressure rating on the keg first and do not exceed that pressure. The PRV should open before you get to max pressure.