Ok, let me make sure I understand you correctly. You have NodeRed running on a rPi which has one or more relays connected via GPIO, right? Then, you want to install HASS on a VM on another machine, but be able to control the relays on your rPi?
You can do this using the remote GPIO functionality. You can also expose NodeRed flows to HASS using the HA pallete and vice versa.
However, a much easier solution would be to put HASS in a Docker on the same rPi as your NodeRed install. That way, your HASS has local access to GPIO on your rPi directly. Of course, this all depends on which rPi you have and what else you already have running there.