The Labrador ended up in the waterlogged pit in Beaconsfield at about 11:45 BST after her owner accidentally left a gate open.
Crews sent from three stations used a telescopic pole to secure the animal and bring her to safety.
The dog was very muddy and looked somewhat sheepish after her ordeal, but was uninjured, the fire service said.
More tails from the Buckinghamshire newsroom
Crew Commander David James, from Buckinghamshire Fire and Rescue Service, said: "The dog was about eight feet away from solid ground and when we tested the depth of the mud with a wading pole we found that it would be chest-deep if a person entered it."
"The owner was obviously very upset, so the first thing we did was to calm her down so that the dog wouldn't pick up on her anxiety."
Crews used a telescopic six-metre reach pole which they were able to attach to the dog's collar to help her get her footing.
"It's always best to call us in situations like this rather than try to get the animal out yourself," a spokesman for the fire service said.
"We have the proper training and techniques to carry out this sort of rescue.
"Too often we end up having to rescue a person who has tried to get their own animal out of trouble."
A blind and partially deaf dog was rescued by firefighters from a muddy swamp after escaping across a field.