The incident happened close to Duxbury Park Golf Club in Chorley at around 7.15pm.
One fire appliance from Chorley Fire Station attended.
A spokesperson for Lancashire Fire and Rescue Service said: “It was a little, long haired terrier. It had probably decided to chase after something.
“It was approximately four metres underground.
“We were lucky, the pipe was quite shallow so we managed to dig down and break the pipe and get the dog out.”
The spokesperson said the pet’s owners, “a middle aged lady and her teenage daughter” were there at the rescue.
He said the dog was unharmed after being pulled from the pipe, adding; “It tried to get back down again.”