Idioms often have a literal origin but a figurative meaning. To "duck" is to lower one's head to avoid something. Idiomatically, it means to avoid a task or responsibility in a similar, often evasive, way.
The phrase "to duck out of something" is an idiom. The passage uses a literal meaning: "If you see an object moving quickly towards your head, you'll feel an urge to duck out of the way" (i.e., physically avoid being hit). The broader, more common idiomatic meaning is to avoid a responsibility, duty, or unpleasant task. Option (B), "To avoid doing something," is the correct definition of this idiom.