Let me address this issue legally.
Understanding the Indian Contract Act
This issue falls under the Indian Contract Act. When an offer is made and accepted, and such acceptance is communicated to the other party, it automatically becomes an agreement. In the case above, one party has already acted upon it as he must have resigned from his first company.
Revocation of Offers and Acceptances
According to Section 5 of the Indian Contract Act, an offer may be revoked at any time before the communication of its acceptance is complete as against the proposer, but not afterwards. The section is reproduced below:
"5. Revocation of proposals and acceptances. - A proposal may be revoked at any time before the communication of its acceptance is complete as against the proposer, but not afterwards.
An acceptance may be revoked at any time before the communication of the acceptance is complete as against the acceptor, but not afterwards."
So once you accepted their offer and communicated its acceptance to them, they are bound by the agreement. All you have to do is to formally accept it by any means like by email, post, or personally, but I would recommend a written acceptance like an email or post.
Legal Recourse Under The Specific Relief Act
If somebody revokes the offer at the time of joining, they can be dragged to court under The Specific Relief Act for non-performance of the contract, and the agreement may be enforced specifically.
Concerns About Termination After Joining
In my opinion, it is not a cakewalk to play with someone's career. Don't worry, legally, a lot can be done. As far as the question of letting you join and terminating afterwards is concerned, they have to show your underperformance, and you can challenge that in the Labour Court. However, action speaks louder than words; if a person performs well, the company never thinks of terminating him. So don't worry and proceed with your career.
Feel free to revert in case any clarification is needed.