Yes they can be locked up, they are more protected that way. I have 3 acres and no neighbors, thats why mine free range. As long as yours have enough room they will be fine. Some times mine may stay cooped up for a few days. Just keep them fed and they will be happy.
Agreed, chickens can be perfectly happy and healthy in an enclosed area. In fact, most people that have them in town keep them in almost all the time. As long as their run is big enough they'll be fine. I don't know how many chickens you have, or if you've built your coop yet, but you could also build a chicken tractor, which is a portable chicken coop. It's nice to have when you keep your chickens enclosed all the time because it's easy to move around so that they can get fresh grass everyday!
Mine stay inside for days at a time, especially in the winter. I give them the option of coming out when the weather is decent but with the snow on the ground, most of them turn right back around and head indoors again! If they come out for treats, its because a few of the smarty pants fly from the run to where the treats are then fly back to the run entrance immediately after. Many of the breeds do well with confinement. The coop & run is a place of security for them. Come Spring time, I'll let them out more again (when I'm home to supervise them). For now, they want nothing to do with this miserable freezing rain/snow we've been getting! Frankly, neither do I!