It's definitely not illegal to drive in pyjamas – you can wear pretty much any form of clothing. According to Times and Star: “Under Rule 97 of the Highway Code, drivers are advised they must have 'footwear and clothing which does not prevent you using the controls in the correct manner'.”