In principle, you're free to leave your estate to whomever you like, irrespective of their relationship (or lack of it) to you. You simply need to write a clearly-worded will to that effect. (There are some circumstances under which family members, or others, might launch a legal challenge to your will after your death but they'd need to show that they had a right to 'reasonable provision' from your estate. That's unlikely to matter where there are no surviving relatives anyway).
Neither of the two beneficiaries of my will are related to me and I can think of no reason why any relatives of mine would be able to launch a valid challenge to the provisions of that will.