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.

Dave Duncan, of Otley, West Yorkshire, set up a crowdfunding campaign to help Lukasz Urban's relatives.
Mr Urban was found dead after his lorry was crashed into the Breitscheidplatz market in December, killing 12 people.
Mr Duncan said he felt compelled to help his "fellow trucker".
Attacker Anis Amri left at least 48 injured when he ploughed into crowds at the German market.
Mr Urban, a Polish national, had been stabbed and shot.
The driver had arrived in Berlin ahead of schedule to deliver steel beams and was asked to return the next day to unload his trailer.
Mr Duncan said: "If they had unloaded their freight none of this would have happened and Lukasz would have been able to go home and spend Christmas with his family."
He said it was that thought that made him want to do something to help "the innocent people left devastated by this".
"It could have been any one of us there that day," he added.
Since setting up the online fund, Mr Duncan has met Mr Urban's widow and son.
He said: "They were extremely grateful and shocked by the support, and that a stranger would help them this way when nobody else would."
Mr Urban's family invited Mr Duncan to attend the driver's funeral in Banie, near the Polish border with Germany.
He said it was "a beautiful ceremony in a beautiful place", adding: "Although I felt detached by the language barriers, it was very moving, especially the amount of people who came to pay their respects."
The Polish ambassador, Arkady Rzegocki, honoured Mr Duncan on Monday for his actions.
He said the lorry driver's "gesture and presence at the funeral of the late Mr Urban, have been greatly appreciated in Poland".
Mr Duncan added: "The Polish truckers' own tributes are what being a truck driver is all about.
"We have to watch out for one another, as in most cases nobody else does."
Mr Rzegocki said he wanted to "personally thank Mr Duncan for his selfless initiative".
"His compassion moved many both in the UK and back in Poland. It is an inspiring example of British-Polish solidarity which never fails in times of crisis," he added.
The ceremony took place in London at the Embassy of the Republic of Poland.

Police found a man, thought to have been cut with a knife, in Bracebridge Drive, Bilborough, at about 15:00 BST on Thursday.
A short time later the PCSO, who was involved in looking for the suspects, was attacked.
Two men were arrested and have been bailed pending further inquires.
The stab victim was taken to hospital but has since been released.
A Nato oil tanker has exploded in northwest Pakistan, killing at least 15 people, say officials.
[NEXT_CONCEPT]
A trucker who raised nearly £200,000 for relatives of the driver killed in the Berlin Christmas market attack has been thanked by the Polish ambassador at a ceremony in London.
[NEXT_CONCEPT]
A Police Community Support Officer (PCSO) has been assaulted while trying to catch a man believed to have been involved in a stabbing in Nottingham.