It's not Nikon, but Canon's Digital Photo Professional writes all changes in EXIF metadata directly to the raw file. DPP does not even offer the option of using external sidecar files to hold editing data. It is always included in the maker notes section of the metadata within the main file. There is no external catalogue to fall back on. There is only the data contained in the image file.
This includes "star" ratings of 1-5 stars. Other raw processing applications, such as ACR, CaptureOne, etc. can read these star ratings if the raw file is copied to another machine and later opened in those other applications.
The above would seem to indicate that writing such data directly to the file is not only possible, but practical and relatively risk free.
I've never experienced a corrupted .cr2 file that wasn't my fault for doing something such as accidentally deleting a fragmented file and overwriting part of the medium that contained the file before attempting to recover the deleted file or some other kind of ID10T error.
To be more specific, I currently have archived in triplicate upwards of 250,000 .cr2 files processed only with various versions of Canon's DPP. Not a single XMP sidecar file exists anywhere for any of those .cr2 files. I have yet to encounter a single instance of an unexplained corrupted .cr2 file out of those 750,000 plus examples.
If anyone is experiencing issues with corrupted files as a result of not using discrete XMP sidecar files to save changes to the metadata of raw image files, I would suggest the issue might be with the application one is using, or perhaps with the file system one's OS is using, and not due to the act of writing metadata changes directly to the raw file.
Canon also has a "checkmark" system, totally distinct from the "star" rating system, that is, as far as I know, only recognized by Canon's in various house software applications.