Concept:
Dipole moment measures the separation of positive and negative charges in a molecule.
A molecule has:
• Zero dipole moment when the bond dipoles cancel each other due to symmetrical geometry.
• Non-zero dipole moment when the molecular shape is unsymmetrical and dipoles do not cancel.
Thus, molecular geometry plays a very important role in determining dipole moment.
Step 1: Examine the molecules in option (A).
\[
\mathrm{CO_2}
\]
has linear geometry:
\[
O=C=O
\]
The two bond dipoles are equal and opposite, so:
\[
\mu=0
\]
\[
\mathrm{NH_3}
\]
has trigonal pyramidal geometry due to one lone pair on nitrogen. Dipoles do not cancel completely.
Hence:
\[
\mu \neq 0
\]
\[
\mathrm{H_2O}
\]
has bent geometry because of two lone pairs on oxygen. Therefore:
\[
\mu \neq 0
\]
Thus, option (A) is incorrect.
Step 2: Examine the molecules in option (B).
\[
\mathrm{NH_3}
\]
is polar:
\[
\mu \neq 0
\]
\[
\mathrm{NF_3}
\]
also has trigonal pyramidal geometry and possesses a small but non-zero dipole moment.
\[
\mu \neq 0
\]
\[
\mathrm{BF_3}
\]
has trigonal planar symmetrical structure. Bond dipoles cancel completely.
\[
\mu=0
\]
Since all molecules do not have zero dipole moment, option (B) is incorrect.
Step 3: Examine the molecules in option (C).
\[
\mathrm{PF_3}
\]
has trigonal pyramidal geometry and is polar.
\[
\mu \neq 0
\]
\[
\mathrm{NH_3}
\]
is also polar.
\[
\mu \neq 0
\]
\[
\mathrm{CH_4}
\]
has tetrahedral symmetrical geometry. Dipoles cancel completely.
\[
\mu=0
\]
Hence, option (C) is incorrect.
Step 4: Examine the molecules in option (D).
\[
\mathrm{CH_4}
\]
has tetrahedral symmetrical geometry.
\[
\mu=0
\]
\[
\mathrm{BF_3}
\]
has trigonal planar symmetrical geometry.
\[
\mu=0
\]
\[
\mathrm{CO_2}
\]
has linear symmetrical geometry.
\[
\mu=0
\]
Thus, all molecules in option (D) have zero dipole moment.
Therefore:
\[
\boxed{\text{Option (D) is correct}}
\]