Hello,
Yes your previous employer is at the liberty to take legal action against you to pay the salary in lieu of the notice period, if the same is given in the employment agreement.
They can not charge the salary in lieu of notice period only if such clause does not exist in your employment terms.
regards