Wiring a thermostat is one thing, and though I’m not familiar with electrical codes at all I can’t imagine that any US building codes prevent users from installing their own—or I don’t think that they’d be so readily available and popular at Home Depot and Lowes, et al.
But an electrical cutoff to the pilot light on a 1940s vintage furnace sounds like something else. A gas furnace of that age is not going to have electronic ignition, but a continuous pilot light that’s not intended to be turned on and off (not that I can see a reason why not). I don’t think an oil furnace would have a pilot light—but I could be wrong about that, too.
With all that you’re trying to do, I guess I’d want a competent, qualified—licensed—electrician, too.