Yes you can do that. It's pretty much an old fashioned way of doing it though similar to a noise bridge.
Not sure what tools are present with the HackRF one but all you need is a reference power into the SDR front end from a 50 ohm termination instead of the antenna, then the peak return loss at the frequency of interest. You can convert that into a VSWR using the table here:
https://www.electronics-notes.com/articles/antennas-propagation/vswr-return-loss/vswr-return-loss-conversion-table.php ... it's easier to look for the power dip though in the SDR waterfall as that represents where the most power is being eaten by the antenna and lowest VSWR.
If you want absolutely measurement it's much better to skip the noise generator and use a signal generator and power sensor. I use an AWG and homebrew AD8307 power sensor for this.