Police said the tanker, transporting fuel to Nato forces in Afghanistan, was hit by a bomb overnight near the town of Landi Kotal in the Khyber region.
People gathered to collect spilt fuel when another fire broke out, said one senior police official.
At least 14 other Nato tankers were damaged in  a separate attack nearby, at the Torkham border crossing.
The region is a crucial transport route for supplies destined for Nato forces in Afghanistan but the convoys frequently come under attack from militants and criminals.
Local official Shafeerullah Wazir said the tanker was hit by a small bomb in the early hours of the morning.
"The oil tanker caught fire after a blast caused by a small bomb before dawn," the AFP news agency quoted him as saying.
"Villagers from nearby houses rushed and started collecting oil coming out of the destroyed tanker after the fire had been extinguished.
"Suddenly the fire erupted again and at least 15 people including five young boys who had been collecting oil in their buckets were burnt to death."
There were no injuries at the separate attack at Torkham.
No group has claimed responsibility for the attacks, but there has been an increase in Taliban activity since al-Qaeda leader Osama Bin Laden was killed in the Pakistani town of Abbottabad on 2 May.
In the deadliest incident, more than 80 people were killed by a twin suicide bombing targeting police recruits in the north-west.
On Friday, one person was killed and 10 injured when the Taliban attacked a US consulate convoy in Peshawar - the first attack on US interests since US commandos killed Bin Laden.
The Pakistani Taliban said the bombing was to avenge his death.
A Nato oil tanker has exploded in northwest Pakistan, killing at least 15 people, say officials.