Yes, in fact many loss making companies receive repayments from R&D which can be a lifeline to them when cash flow is tight. The claim is made by amending the tax return. Losses can be exchanged for a repayment at 14.5%, so can be very valuable to the company.
The amount that can be surrendered is restricted to the loss relating to the R&D projects rather than the loss from general trading.