Six years ago, 461 Dean Street — then and now the nation’s tallest modular apartment building at 32 stories — opened its doors on Flatbush Avenue in Prospect Heights, Brooklyn. The 363-unit tower had been plagued with four years of delays, lawsuits and leaks, and disputes with the project’s contractors almost derailed construction completely. Despite 461 Dean’s troubled history, low-rise modular construction has expanded quickly over the past few years in the Western U.S. and Canada, serving areas where detached homes and three-story apartment buildings are the norm. Some cities and states are even hiring modular builders to provide temporary relief housing in the wake of hurricanes, floods and tornadoes, instead of the much-maligned FEMA trailers. Modular accounted for about 5.5 percent of the North American construction industry last year, or roughly $200 billion worth of construction starts, according to the Modular Building Institute, a trade group.