Typically it is legal for a company you work for to send you to training, but then bill you (typically prorated) for the training cost if you leave the company within a specified time after. And that seems somewhat reasonable in many cases. But then again, a company can come up with "mandatory" annual training with an inflated cost, with a 2-year escape clause, to effectively prevent employees from leaving.
It is in some states, like Texas. It wouldn't be in CA.
A "quitting fee" is generally illegal throughout the U.S...which is why Revature has the boot camp. Instead of being a quitting fee for leaving the job, the "quitting fee" is characterized legally as reimbursing Revature for the tuition costs of the bootcamp.