We present Submillimeter Array 880 µm dust polarization observations of six massive dense cores in the DR21 filament. The dust polarization shows complex magnetic field structures in the massive dense cores with sizes of 0.1 pc, in contrast to the ordered magnetic fields of the parsec-scale filament. The major axes of the massive dense cores appear to be aligned either parallel or perpendicular to the magnetic fields of the filament, indicating that the parsec-scale magnetic fields play an important role in the formation of the massive dense cores. However, the correlation between the major axes of the cores and the magnetic fields of the cores is less significant, suggesting that during the core formation, the magnetic fields below 0.1 pc scales become less important than the magnetic fields above 0.1 pc scales in supporting a core against gravity. Our analysis of the angular dispersion functions of the observed polarization segments yields the plane-of-sky magnetic field strengths of 0.4-1.7 mG of the massive dense cores. We estimate the kinematic, magnetic, and gravitational virial parameters of the filament and the cores. The virial parameters show that in the filament, the gravitational energy is dominant over magnetic and kinematic energies, while in the cores, the kinematic energy is dominant. Our work suggests that although magnetic fields may play an important role in a collapsing filament, the kinematics arising from gravitational collapse must become more important than magnetic fields during the evolution from filaments to massive dense cores.