Depends where you are - yes they are legal and the company can pursue you for repayment in most countries.
That being said its not unknown for somebody to just disappear without paying back the bond - especially where the company is in the ME or Asia.