NVM.dat is completely a binary file so it’s not really human readable. Its format is documented here:
assuming your newly installed OSPi firmware matches the firmware version in your nvm.dat, I would think copy and pasting it should work. The problem is that if the firmware is a different version than what the nvm.dat stores, it will trigger a factory reset and recover nvm.dat to default settings.
Because of the difficulty of directly dealing with this file, the better way is to use the app or web UI to export configurations to a (JSON) file and import those after re-installation. The exported configuration files are human readable.