There are many families who live in the Frederick area and commute to DC but it is dependent on what you feel is an acceptable time to spend commuting.
The MARC train runs from Downtown Frederick but is not all that frequent. You can check out the routes and schedules on the following website.
It would also depend on where you were thinking of living. Anything close to 270 would help to reduce commuter time should you be thinking of driving.
Feel free to give me a call if you would like to discuss this and I would be happy to help in any way that I can. 301 865-9675.