Context. The magnetic field strength in interstellar clouds can be estimated indirectly from measurements of dust polarization by assuming that turbulent kinetic energy is comparable to the fluctuating magnetic energy, and using the spread of polarization angles to estimate the latter. The method developed by Davis (1951, Phys. Rev., 81, 890) and by Chandrasekhar and Fermi (1953, ApJ, 118, 1137) (DCF) assumes that incompressible magnetohydrodynamic (MHD) fluctuations induce the observed dispersion of polarization angles, deriving B ∝ 1∕δθ (or, equivalently, δθ ∝ MA, in terms of the Alfvénic Mach number). However, observations show that the interstellar medium is highly compressible. Recently, two of us (ST) relaxed the incompressibility assumption and derived instead B ∝ 1/√δθ (equivalently, δθ ∝ MA2). Aims. We explored what the correct scaling is in compressible and magnetized turbulence through theoretical arguments, and tested the assumptions and the accuracy of the two methods with numerical simulations. Methods. We used 26 magnetized, isothermal, ideal-MHD numerical simulations without self-gravity and with different types of forcing. The range of MA and sonic Mach numbers Ms explored are 0.1 ≤ MA ≤ 2.0 and 0.5 ≤ Ms ≤ 20. We created synthetic polarization maps and tested the assumptions and accuracy of the two methods. Results. The synthetic data have a remarkable consistency with the δθ ∝ MA2 scaling, which is inferred by ST, while the DCF scaling failed to follow the data. Similarly, the assumption of ST that the turbulent kinetic energy is comparable to the root-mean-square (rms) of the coupling term of the magnetic energy between the mean and fluctuating magnetic field is valid within a factor of two for all MA (with the exception of solenoidally driven simulations at high MA, where the assumption fails by a factor of 10). In contrast, the assumption of DCF that the turbulent kinetic energy is comparable to the rms of the second-order fluctuating magnetic field term fails by factors of several to hundreds for sub-Alfvénic simulations. The ST method shows an accuracy better than 50% over the entire range of MA explored; DCF performs adequately only in the range of MA for which it has been optimized through the use of a “fudge factor”. For low MA, it is inaccurate by factors of tens, since it omits the magnetic energy coupling term, which is of first order and corresponds to compressible modes. We found no dependence of the accuracy of the two methods on Ms. Conclusions. The assumptions of the ST method reflect better the physical reality in clouds with compressible and magnetized turbulence, and for this reason the method provides a much better estimate of the magnetic field strength over the DCF method. Even in super-Alfvénic cases where DCF might outperform ST, the ST method still provides an adequate estimate of the magnetic field strength, while the reverse is not true.