Yes. A thermostatic radiator valve (TRV) can be attached to a heated towel rail, and will offer the same functionality as it would when teamed with a home radiator.
However, we wouldn't recommend using a TRV on a towel rail in a bathroom or shower space, as the damp and humid conditions of such rooms can have an impact on the effectiveness and efficiency of a TRV.
If you would like any further information, take a look at our dedicated blog, How To Choose The Correct Heated Towel Rail Valves. Or, to draw inspiration on the best heated towel rails to add to your home, explore our blog - The Ultimate Heated Towel Rail Buying Guide.