It is not illegal to apply for a job. But you should be ready to arrange a release letter from your present sponsor. If you are under family sponsorship, should be register with the labour dept.