It can. You can set up a trust in your will and make your daughter the beneficiary. There are a number of ways such a trust could operate — you would need to take legal advice — but her husband would have no legal right to the capital or the income, either while she is alive or if she dies before him. The trust might be taken into account in any divorce settlement.
Trusts are flexible so you may want to set one or more up for other purposes too, such as to provide a fund to pay for your grandchildren’s education when they are older, or for a disabled member of the family.
The tax treatment varies for different types of trust. You need to think about the inheritance tax, income tax and capital gains tax consequences. This is a complex area where you need specialist advice on your particular circumstances.