Question: If my detached garage has natural gas connection to the house via a buried black pipe and if the house got caught on fire, can that pipe, say 25' in length, conduct the flame to the garage so that it catches on fire with no other source of ignition?

I was thinking that a buried pipe should not be able to do that because fire requires air, which is not available inside a buried pipe. Correct me if wrong.

Answer: 
A gas pipe is filled with nearly 100% flammable gas—at least under normal conditions.

Propane and natural gas need to be mixed with air (or oxygen) to be combustible. The [ideal combination](https://en.wikipedia.org/wiki/Stoichiometry#Stoichiometric_air-to-fuel_ratios_of_common_fuels) for natural gas is 1 part fuel (by volume) to 9.7 parts dry air. A mixture of more than 15% (1 to 6.67) natural gas is *not* combustible!

So, no. Under normal conditions, a flame applied to one end of the gas pipe would not be conducted anywhere.
In normal circumstances no. **But.** If there should be any work done on pipework close to your connector pipe, it must be purged of all air. As mentioned, gas is not combustible in the way it's normally transmitted. But if the pipe has air in it because it was vented prior to some work, gas is turned back on, the air mixes with the gas to become combustible. Then maybe boom. 

This is why in the UK Gas Safe builders are trained about this risk. This is also why you sometimes hear on the news about a whole street exploding due to the gas main going up. This is how that happens. Just make sure all your pipework is purged subsequent to doing any diy on it.