Most people I know who spend a lot of their life involved in dealing with, interpreting, and otherwise studying them, have a pretty consistent definition in their minds when they use the terms.
A Code is a requirement, where a Standard is good practice, or suggested guidance. A Standard may be adopted as Code by an authority, therefore in that jurisdiction, it is a Code, but the reference source of the code is a Standard. ASME does not write codes. Neither does ASTM, API, NFPA, etc. In the US, OSHA writes codes for the country (the jurisdiction). I don't know really what the legal situation was with the agency that wrote the BS (British Standards), so I don't know that these terms were similarly applied. BS are no longer the "code", as those are now done by IEC or other international agency.
However, in the US, any Code may be excepted (the owner may take exception to it), as long as the owner is willing to 1) accept the consequences, and 2) has a paper trail documenting it's acknowledgment of the exception, and why (perhaps based on extensive history and data, for instance, or another means of assuring safety and performance).