Paying employees cash is not illegal, you can pay your employees via various methods via online banking, cheque or cash.
However, you must be aware of the tax and NIC implications of how much you are paying an employee and all amounts still need to be reported to the HMRC via Real Time Information. For example, if you pay an employee £500 cash per week, you need to know how much tax and national insurance you will need to hand over to HMRC on their behalf.
So if you have an accountant or a payroll agent running your payroll for you and ensuring the correct amounts are grossed up through payroll and the correct tax and NIC is calculated, deducted and paid across to the HMRC and reported through Real Time Information, or you are running your own in-house payroll and paying employees their net amounts due in cash – then it is not illegal.