The ship carrying the Bangladeshis will bring back Myanmar security personnel who crossed the border recently amid fighting with rebels
The accident occurred late on Friday night at a home in Ashulia, said local police OC Abdul Awal.
The victims are tenants Al Mamun, 22, his wife Parul Begum, 20, visiting relative Md Asadul, 30, and his wife Sumaiya Akhtar, 18.
According to a neighbour, the four were asleep in the same room when a plastic pedestal fan exploded, set the room on fire and broke the windows. Neighbours rushed to the scene and doused the fire.
Police are investigating the cause of the explosion, Awal said.