How will you be sealing around where the cord comes out of the primary? If you seal it well I can't see why it would not work but most people find they get good temperature readings buy taping it to the outside of the fermenter.
If you are looking at this for a long term solution try a thermowell from many online home brew shops or from this guy. He has an adjustable one as well so you can control the depth of the thermowell.