High pass filter (HPF) removing the DC component of the voltage
That circuit is a high pass filter (HPF). Specifically a single pole RC, buffered HPF.

If you want to remove DC (0Hz) from your 50kHz to 50.5kHz frequency sweep, then indeed it doesn't matter to you whether the cutoff frequency of the HPF is 160Hz, 10kHz or 20kHz. But if you had a 5kHz to 50.5kHz sweep, then only the 160Hz version would work.

What matters is the RC time constant, where R is not only that actual R that's drawn in the schematic, but also any component that's connected across it. As it happens, the TL072 opamp is a FET input type, and doesn't load that resistor by any significant amount. However, if the TL072 wasn't there, and you wanted to drive a low impedance load, then the load would have to be taken into account to get the effective value of R. That's the benefit of buffering the output with a unity gain amplifier, any load does not affect the filter.

The 10nF + 100kohm values you mention have a 1mS time constant, giving a cutoff frequency of 1000 radians/s or about 160Hz. You could get the same filtering action with 100nF and 10kohm, or 1nF and 1Mohm. If you used 10uF and 1kohm, it would take more current to drive the input. If you went as far as 1pF and 1Gohm, then you would need to start worrying about the loading of the opamp and noise, but the RC time constant would still be correct.