Depends. If the rule says "shall", "must" or some similar 'command' word, then there's very likely to be legislation behind it.I think, from my NEEBOSH days, a code is just that a code of conduct. I haven't read the Highway Code for a number of days and am not legally trained. However, it's my understanding (and I'm open to correction) that if you "break" the code you may be prosecuted under a relative law?
If it's "should", "may" or some similar 'optional' word, it will be advice or guidance only. Advice or guidance that may see you dead if you ignore it but nothing you can be nicked for.