My understanding is that the “lockdown” in Boston, Cambridge, and Watertown was technically voluntary. Martial law was not declared nor was a State of Emergency declared. The request worked I think in large part because people were still in shock over the bombing and to a great extent the culture in Massachusetts is amenable to cooperating with authorities in that manner. Where it went wrong is with those who did go out, including media people, who were being stopped and frisked without warrants with police & the military acting as if it was a mandatory lockdown.
After the shoot out with the older brother and the search being narrowed down to Watertown where they went house to house, most people cooperated and gave permission for the police/military to search their homes. Again, it fits the culture. My understanding is that those who didn’t consent had their homes searched anyway without warrants. I also saw scenes on TV of people coming out of their homes with their hands in the air. That hardly looked like voluntary searches to me, especially when the police knew exactly who they were looking for and what they looked like. Whether it was the police, federal agents, or military acting as if martial law had been declared, it was happening to some extent.