KARACHI, Pakistan — Fire ravaged a textile factory complex in the commercial hub of Karachi early Wednesday, killing almost 300 workers trapped behind locked doors and raising questions about the woeful lack of regulation in a vital sector of Pakistan’s faltering economy.