Quantum fluctuations and correlations in equilibrium and nonequilibrium thermodynamics