There is no reason a convicted criminal cannot benefit under a will, unless the gift fails under the public policy of forfeiture.
Does the testator intend that the legacy lapses if, say, the intended beneficiary is involved in further criminal acts? If so, perhaps the cleanest way would be to use a discretionary trust and give the executor(s) directions as to the circumstances in which they would not want the legacy to be paid. To try and craft a clause identifying suitable levels of criminality may be a hostage to fortune. By way of example, with regard to speeding, referred to in a previous post, I understand that it is only “criminal” if the accused does not comply with the fixed penalty notice but goes to court and, if found guilty the offence, whilst a “criminal conviction”, does not result in a criminal record.