Thermal and quantum fluctuations in chains of ultracold polar molecules