A alert sent to mobile phones by Bangkok authorities confirmed that the fire was under control, but urged people to avoid the area.
Eyewitnesses shared video clips on social media of flames and smoke rising above the refinery.
The city-run Erawan Emergency Medical Centre said it was treating four "red" cases and three "yellow" - less severe - cases.
On a visit to the scene, Thailand's energy minister Akanat Promphan said it appeared the impact of the explosion was limited because the fire started in a distillation tower about 100m (330ft) from where oil was being stored.
He said the incident was concerning as the refinery was in a residential area and the government was suspending production until it could be confident that operations would resume without any issues.
Bangchak Corporation said air quality monitoring in the immediate area around the refinery was within normal ranges.
It confirmed that production at the site, which can process up to 120,000 barrels of oil a day had been shut down. The company has a second refinery in Chonburi province, about 50 miles (80km) from Bangkok, handling a daily capacity of about 180,000 barrels.
An explosion occurred at the Bangkok refinery in July 2012, sparking a fire but no reported injuries.