Yeah, you should be able to do that. Of course, if you accidentally pull out the power cable, or you have a power failure in your house, the latptop will immediately shut down.
I knew a guy who would always take the battery out and run it on the AC power when he was at his desk, he claimed that it would increase the lifetime of the battery. There are loads of tips and tricks out there on how to increase the life of batteries but I'm just too lazy to care.