Sure you can. In fact, most writers do not make enough money to write full-time, so they need a day job that pays the bills. There are scientists who write Part-time, stay-at-home moms with toddlers, police officers, high school and college teachers, you name it, and you'll find that they're not full-time authors.
If you want to be a full-time author, meaning your only source of income comes from your books, then you'll have to give up your day job, but you don't have to if you don't want to.
Good luck.