Irving Oil confirmed the incident on social media and said that all workers were accounted for.
Several contractors are in hospital with non life-threatening injuries.
Police in the town of St John, New Brunswick urged residents to avoid the area.
No air quality issues have been reported so far.
On Twitter, St John Police said: “We are actively assessing the situation at this time and will share more information when available.”
Video footage from the scene shows the size of the blaze. The fire has now been extinguished.
Wendy wrote on Twitter: “Explosion shook the entire house. Praying everyone is safe. Waiting to hear if we are supposed to evacuate.”
Rob Beebe told CBS News: “We felt the entire building move as if it wobbled. We’re sitting here and watching it burn right now. It’s getting larger.”
People as far as three kilometres away reported hearing the explosion.
The refinery employs 1,400 workers and is situated on a plot with “thousands” of neighbours. according to CNBC News.
The refinery is the country’s largest and has the capacity to refine 320,000 barrels per day of gas, diesel, heating oil, jet fuel and other petroleum products.