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: 
The possibility of the natural gas line transmitting the fire is extremely close to zero. Yes natural gas requires air, about 20% mixture of gas and air (more air than gas). Getting that mixture in a closed pipe, along the entire pipe, would near impossible without some pre-mixing first before the fire.

Also if fires could be transmitted via the gas pipe lines, entire cities would be at risk if just one house caught fire.
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.