Most of the injured suffered burns and three people were in critical condition, according to Erawan Medical Centre in Bangkok.
Video posted on social media showed thick, black smoke rising from the site in an eastern neighbourhood of Bangkok.
A mobile phone alert sent to residents said the incident happened about 3pm on Thursday and advised people to avoid the area.
The city authority reported less than an hour later that the ensuing fire was put out.
Officials later said nearby residents can return home, but advised those living in a 5km radius of the facility to be cautious of air pollution.
The Pollution Control Department said it sent officials to assess air and water quality in the surrounding area.
Bangchak Corp, which owns the refining and storage facility, confirmed the fire in a Facebook post and said the cause was being investigated.
The company also said it had halted all production operations.
Energy Minister Akanat Promphan said the fire appeared to start at one of the refinery units, which is about 100 metres away from the oil storage.
He said he would inspect the site to ensure there's no further risk.
"If we're not a hundred per cent certain that the oil storage is safe, we won't allow them to resume operations," he said.
Akanat said Thailand's oil supply should not be affected, as there were five other refineries in the country and this facility was not among the biggest.
The refinery, with a listed capacity of 120,000 barrels a day, is the fifth biggest in Thailand and the only one in an urban area.
An explosion and fire at the refinery in July 2012 caused damage in a nearby residential neighbourhood and it took two weeks to repair the facility.