Depends.
There is no statutory bar.
That said, a testator can certainly make it a condition of nomination as an executor
that the person not be (or not have ever been) a bankrupt.
Further, it is quite common for one or more beneficiaries to object to the application
on the basis of the person being a current or former bankrupt.
(as an side note, it is also becoming more and more common
for testamentary gifts to be conditional upon the recipient not being a bankrupt,
but that's another thread...)