You can't actually rotate any file. You only can rotate images, then save those images to a file.
But it is usually not possible to write (in the sense of changing the sensor data) RAW files; it would be possible theoretically, of course (your camera does it), but no software i'm aware of does it, not even the proprietary ones of the camera manufacturers.
What might be possible, with tools like exiftool, is to change some of the other data (aka metadata) contained in the file, like the thumbnail or EXIF fields, and set the flag in the EXIF data which indicates camera orientation to rendering software. Usually this isn't terribly useful since RAW files aren't practical for direct viewing anyway, you typically open them in some image conversion software and save them eg. as JPEG. Or you apply all edits you like "virtually" in software like Lightroom which applies those edits on the fly when viewing the image.