It's incredibly easy to do (caveat - at least if you're familiar with software dev already).
Most thermostats are literally just digital thermometers that control a relay that turns the furnace/ac on and off.
A simple arduino (or much cheaper IC) can easily do the same thing if you wire it in.
And then on the software side... there's several large, open-source projects that exist in this space and provide nice api tooling for interacting with those devices. Things like:
I'm considering making an OpenTherm controller for my heating boiler, I just researched this topic a few days ago - it's absolutely true, there are ready-made Arduino libraries for that.