How can I install heat tape on a hard to reach PVC drain pipe?
This is actually similar to another answer I just gave.

It's generally referred to as "heat line" when it goes inside a pipe, which may help you find some products.

You don't give many details about your application, but in general, I'd recommend self-regulating heat line instead of using a thermostat. This line basically turns on as it needs to in response to temperature, and this actually happens just on the particular spot that's cold (eg, the whole line doesn't have to be on or off). 

The insert adapter that lets you connect the line can be installed anywhere.