Being on any form of benefits will not change your legal Right to Buy eligibility, however any lender will need to make sure you are able to afford your monthly mortgage repayments.
One thing that may be affected is your ability to receive certain benefits, such as Housing Benefit, which cannot be received if you are a homeowner.