Of course you can do that! I have a couple of suggestions, though, based on my method.
First, you don't want the heater actually inside the fermenter and in the beer. Beer is very sugary (that's what ferments) and I think a heater would be a bad idea. Sanitizing would be tough, temperature control would be tough, etc.
What I do is put my fermenter in an ice cube cooler. Then add water up to the level of the wort. I put my submersible aquarium heater in the water bath, and float an aquarium thermometer in that. The water bath keeps the temperature inside the fermenter as about the same temperature as the water. It works great!!!!!! It keeps the temperature stable, too, with no variations between day and night (when I turn the heat lower).
My house is in the high 50's/low 60s in the winter. I brewed my last batch at 68 degrees using this method. I don't feel like heating my house (which is 100 years old) when no one is home, just to keep my beer comfortable.