Hello Anusha,
You won't like this.
Your line 'I had to abscond and leave due to better offer' is a giveaway of the way you handle your career & core values.
What do mean 'I had to abscond'? Did anyone PUSH you into it? It was YOUR choice....right?
Tomorrow, when you get another better offer, there's no guarantee that you wouldn't hesitate to do a repeat act.
Companies now-a-days focus more on the attitude & integrity of individuals, especially under adverse situations. They would be OK to compromise 'a bit' on the skills but NOT on the ethical aspects.
Coming to your query 'let me know if they can legally do so', Saswata Banerjee has already answered you.
However, pl also note that ANYTHING can be contested in Indian Courts.....how often haven't you seen the most frivolous issues/charges been taken to courts?
Your worry OUGHT to be WHETHER you can handle IF the Company takes you to court. Firstly your time, then your money for advocate, and possibly IF this leaks to your next employer(s), the possible consequences thereof for that job.
And in this case, the Company gave you Training....which they can easily prove, IF it goes legal.
You haven't mentioned whether any Bond was in-place.....and even if it wasn't, advocates can easily handle this particular situation.
Any Bond that's linked to Training is enforceable legally.
Suggest clear off the monetary dues here & come-out clean to avoid any future complications in your career.
But again, you ALWAYS have a choice. It's up to the individual.
Rgds,
TS