An employer cannot give a (subjective) bad reference as this may constitute libel. They can choose not to give one at all or be non committal, but they can't give a bad one.
This is largely true but more complicated than the legal shorthand that often gets quoted. An employer can provide whatever reference they like but should not say anything that is negative that they would not be prepared to defend in court-of-law as the recipient of the reference has the right to sue for defamation of character or plain libel. As the libel laws of Britain are quite strict, employers often opt for the simple don't say anything bad approach.