Is there any software to edit RAW DNG pixel data without demosaic, and save changes directly to RAW?
The RAW data is the RAW data. You do not save changes to the raw file.
I.E. You can not alter the data within the RAW file/container itself.
If you use software to edit the RAW data you then save those edits to another file format such as JPEG or TIFF, the RAW file/container itself is not changed.
I do not know if there is any software that will read a RAW file without first applying demosaic. That is above my pay grade.
I would suggest you do some research on RAW files in books as well as on the internet so you have foundation of knowledge of what one needs to do to work with them. This will help you to ask informed questions.
As user Please Read My Profile demonstrates in his answer to What does an unprocessed RAW file look like?, DCRaw and many of the raw conversion applications which draw upon DCRaw under their hoods are capable of doing what you desire in terms of converting linear sensor output to a viewable monochrome image without demosaicing.
With some raw processors that use DCRaw under the hood you can save the instruction set as a sidecar file or as an internal part of the raw image file, but you can't save the changes to the actual raw sensor output data in the file. The instructions would probably only be readable by the same application that created them, though. You can export what you see on your screen after doing the adjustments as a TIFF or in another raster image format, but you'll have the black point, white point and color multipliers more or less "baked in."
Even though the displayed and exported image is monochrome, the relative tonal values between pixels (in the image) that correspond to sensels/photo sites/pixel wells (on the sensor) filtered by red', green', and blue' filters¹, respectively, will be affected by the color temperature, white balance, and color filters that are applied to the raw luminance values.
¹ We call them red', green', and blue' filters, but they're actually not the same colors as the Red, Green, and Blue primary colors we use in RGB devices. The red' filters in most Bayer masks is centered somewhere around 590-600nm that is more of a yellow-orange color than "Red" at 640nm. Likewise, the green' and blue' filters are slightly different than their RGB counterparts. Blue' filters are a bit closer to violet than RGB "Blue" and green' filters are a little closer to yellow than RGB "Green" is.
For more about DCRaw, which runs on a Linux platform, please see the explanation and FAQs here.
Note that most cameras which were available by 2018 are supported, but newer cameras may not be supported at all and aren't fully supported unless they use the same sensor and raw encoding method as a previous model that was already around in 2018.
I need to adjust the monochromatic luminance values of pixels, and save to RAW again. And then open in a "RAW processing software
This is (basically) equivalent to making an adjustment to exposure in post processing in any RAW processing system. You do not need to save and exit and reload to do that - it can all be done in one go.
Darktable (a free raw processing application I use myself) has an automatic setting for exposure that will do that without user intervention being required if you want. There's the default "manual" setting as well, of course. I'd expect other RAW processing applications to have similar options.
You do not save RAW data back and it would make little sense to do that - it would be like overwriting a negative - you want to keep the RAW data unaltered. That's the point of RAW - to have the actual data recorded that you can always go back to without any processing applied.
While theoretically possible, there is, to my knowledge, no existing software to do that; probably because there is little need for such an operation. If you have a specific need to do this, you'll have to write your own program. You can look into the DCRaw source code to read RAW files, you'll have to implement the writing yourself.
One application i know of that does (did) write to raw was the Zero Noise Virtual Raw project by Guillermo Luijk where he combined multiple RAW exposures into one, as a HDR input. But there seems little use for that as modern RAW processors will handle multiple input files for HDR just fine these days.
So no need to save as raw, you always have the raw file and any editing you do to it. But the other part of the question can partially be rephrased as "can I get the pure luminence values from the raw file?" This would seem to give you a b&w sensor without going to the expense of buying a pure mono camera. My understanding is rawtherapee has a "no demosaicing" option, which I'm guessing is just what the sensor itself sees. Am I correct? Perhaps I can go on to answer my own question. Yes, and no. Yes it's what the sensor sees but no, on a mono camera each pixel sees the entire spectrum but on a colour camera a pixel sees one of red, green or blue segments only.