A fast-moving fire at a bar on the outskirts of Bangkok has killed at least 27 people and injured dozens, with officials probing blocked exits and safety violations.