If the property you are having is self-acquired, you can make a will and give your assets to anybody you like. You can name anybody. There is no rule that he /she should be your legal heir as per law. You can name anybody and no law will come in between. But the conditions are
1. The property is your self acquired and not obtained from your ancestors.
2. You should write a will and notarised it and keep it with your lawyer and he can declare the will after your death.
3. If you want more information, you can contact a lawyer who can guide and help in making a legally valid will.
But in case the property is acquired by you from your ancestors, you have to give it to the legal heirs only.
You can't make anybody you want your legal heir. Who will be the legal heir? As per Hindu Succession Act, the legal heirs are
1. The parents of the person
2. If any of the parents are not alive, her siblings
3. If there are no siblings, legal heirs of the father will be the legal heirs
4.. If the father is not having any living legal heirs, her mother's legal heirs will be the legal heirs.
If you have any savings, you have the nomination facility. You can nominate anybody you like and if there are no claims from any other person the nominee can acquire that money. You can mention these savings also in your will so that he. she can become the sole owner of that money also.