Yes. An executor is entitled to compensation even if they are also a beneficiary of the estate. This is because executor compensation is separate from an inheritance and is paid in exchange for the services performed as part of estate administration.
That said, many executors who are also beneficiaries choose to waive their statutory fee to preserve more of the estate for distribution.
Keep in mind, however, that waiving compensation does not entitle the executor to receive an equivalent amount as an inheritance. Instead, the unpaid fee remains part of the estate and is distributed according to the terms of the will, meaning all beneficiaries share in the additional estate assets based on their respective interests.