A building collapsed while under demolition in Hopkinton on Wednesday, spilling debris onto a sidewalk and into Main Street, officials said. No injuries were reported in the incident at 52 Main St.