Saurabh, what needs to be analyzed here is, if company is terminating an employee without reason that means there is definitely a reason that company doesn't want to share. Those reasons could be consolidation of business (activity or whole), wrong hiring, or a serious diciplinary issue for which the company doesn't want to make a fuss about by discussing that. In either of the cases, the company should issue the experience letter to the employee. But what is important is what they write on that letter? Another important fact is, if they will write neutral comments, then there should also be a resignation acceptance letter to close the case in a proper way. Howerver, in this case there will be no resignation acceptance because there is no resignation as such and instead it is termination without reason.
Ideally, an employee if not provided a justified reason of termination and if there is no chance of remain in existence in the company then should be asking for voluntary resignation instead of termination from the HR authorities. This approach is more collaborative in nature.
If the case of terminaton is due to employee's fault then as well according to moral and proffessional ethics the company should give atleast the conformance of the service with regards to the period that the employee has delivered. However, in such cases, it all depends how the emplyoee reasons out his fault.
As far as legal ways to avoid termination without reason is just by seeing closely the employment contract or offer/appointment letter before signing. The employee should see if there is a clause, "The company may terminate the employement with or without any reason thereof by providing xxx month's basic salary in lieu thereof"....(words may differ)....If this clause is mentioned, then it is absolutely employee's decision to go with that or not. But if he accepts then there is nothing to do with legal left any more. But again this a theoritical aspect. For legal, it more of an actual details that will support the case either in favor or against of the employee.