Updating variables on arduino 8266

Can I set an arduino esp8266 to power on/off a relay based on being above temp X. But have it so I can change the variable X from "the cloud" (aka some vps)?

As an example, I want the microcontroller to turn fan on if over 75 in my house and outside temp lower locally. But I would like to be able to change that from my phone so that its instead going on if it's over 70 and outside temp is lower. Get what I'm saying? I'm not sure how to change a variable without re-programming the whole esp8266 which isnt ideal since I want this manageable online and able to run offline. Main thing is next step will be to set up to thermostat as well.

I searched but couldnt find anything pertaining to this specific topic and I'm likely to new to know what to search first. Thanks!

One way is to utilise the mqtt protocol. Start by doing some research on that. You will find many examples in this forum, and elsewhere. There are also mqtt specific NR nodes available.

Another way is to start a web server or client on esp8266. Parameters can be sent in url or ArduinoJson library can be used to parse a received json string and update corresponding internal variables.

Did you take a look at tasmota, espeasy and other existing firmwares?