It is not a probloem if you can make sure you are buying a fee simple absolute interest, and the title is marketable.
If there are restrictions in the trust, such as passive trust or spendthrift trust, then the trustee is liable to the beneficiary. You may need find out who the trustee is and if he has the power to convey a marketable title. If you know he is selling by breaching the trust then you will also be liable to the beneficiary for damage or equitable relief, meaning giving the house back, because you lost your bona fide purchaser status. If you are not clear how trust works, then don't buy it.