All depends on conditions which have been mutually accepted by both company and employee/trainee.
If the trainee has left without serving notice period, company is well within rights to set off notice period pay against dues to the trainee.
Company should make a clear policy for trainees.
Make out the offer letter clearly mentioning conditions of work/training and exit methods/procedures.It can even mention that cost of training will be recovered if people quit in between.
Cost should be reasonable, quantifiable and proportionate.
9th July 2018 From India, Pune