Is it safe to only replace the gas fireplace thermocouple valve?

Yes, it is perfectly safe to replace only the gas fireplace thermocouple valve provided, of course, that it is not working correctly. The way to determine this is to, first, assure that all of the parts of your fireplace are working correctly, such as the pilot valve, and when you know they are clean and working, remove the white thermocouple wire and reinsert it. If the unit functions correctly, then there's nothing wrong and you're okay. If the unit starts and then stops suddenly, you can be certain that the thermocouple is probably defective and should be replaced.