What do we observe today? Animals walking in mud, along the shores of ponds, lakes or rivers, do not leave tracks that fossilize.
For something to become a fossil, such as a dinosaur skeleton, it must be buried quickly. For a footprint to become fossilized there must be a source of sediment that buries it very quickly. In addition, consistency of the mud the dinosaur steps in must not be too soft or too hard. Soft, slushy mud will not retain the footprint. And if the mud is too hard, the footprint will be very light or not visible at all. Dry sand or dirt will not retain footprints, so there must be mud.
A common theory is that the dinosaurs left footprints in mud along a lake shore; the footprints dried and hardened in the sun; the rising water covered them with sediment; which then further hardened into rock over millions of years. However, experients have shown that footprints can be made in mud underwater, filled with sediment, and then harden... all while completely underwater and within hours.
Because footprints on the shore of a lake can disappear quickly (due to rain, waves, the flow of water, or other conditions) another theory is that the dinosaur's foot sunk deeply into the mud, and when they pulled out the sides collapsed immediately filling the footprint with mud. This quickly buried and protected the footprint. However, when dinosaur footprints from a Massachusetts quarry were cut to reveal a cross section, what was seen was multiple, tiny layers of sediment showing that the footprint was made in, and filled in as a result of moving water. Fossilized water ripples are commonly seen in this quarry. This evidence points to dinosaurs walking in shallow moving water heavily laden with fine grain sediment. This is consistent with the Briefly Exposed Diluvial Sediments (BEDS) model of what happened during the Great Flood.
Dinosaur Footprint Fossil Formation
Basically what happened is that a dinosaur stepped in mud, leaving a depression called a footprint. That footprint was filled and covered with sediment. The sediment hardened and when the rock is split sometimes the original fossilized depression is obtained as well as a natural (raised) cast. (See illustrations) Both are considered original fossils. The above photo shows the depressed fossilzed footprint on the right, and the raised natural cast on the left.