My understanding is that:
In Europe (via the EOBD interface) or the US (via OBD2 interface), essentially identical in protocol, the _basic_ (i.e. generic) error codes are indeed standardised, and must be made available to the consumer (or indy repairer). The OEM however is free to add additional OEM-specific codes (and they do!) and while information can often be found on the internet for those codes, they're not part of the standard.
In Massachusetts, the 2012 Right-to-Repair initiative extended that so that the consumer must have access to the _same level_ of diagnostic information available to the OEM. I'm assuming this would extend to the extended error codes that are more specific?
By basic code, I mean a code which might indicate an "ignition fault" as opposed to an OEM code which might indicate what the actual fault is - is it a voltage issue, a short-circuit, premature ignition firing etc., something much more useful for diagnosis. (Probably a poor fictional example there, but that's my way of seeing it).
I don't believe for a minute that people are looking for the ability to upload custom firmware to the various modules in their vehicles - sure that might be cool, but I can see how that could be a safety issue - but being able to re-flash original signed firmware should certainly be possible, as should reading out whatever information is required to diagnose a problem, and to perform whatever coding actions are required to replace parts and/or modules. Currently such things are often dealer-only and that often means $$ rip-off prices.
On a related note, I doubt this is solely about repairability anyway - for instance, if you have a relatively recent BMW you may discover that you don't have the ability to play music via bluetooth from your phone, despite having the "Bluetooth prep" package installed. Of course, this is solely because that feature is charged separately and has nothing to do with hardware. Can it be enabled later? Absolutely, as long as you have the right adaptor and the appropriate software - it's as simple as setting the right flags to enable it. But given the moves in the industry to switch to subscription-based models, as well as these software-lock based feature sales, that's probably among the larger concerns the industry has around making things accessible? Or perhaps I'm being too cynical in my old age?
Tony