Yes, exercise whenever is best for your schedule. The main thing is that you do it.
I know many people prefer to exercise first thing in the morning, but I have never been able to get myself to do so. I much prefer to work out in the evening. Sometimes I do it right after dinner. Other times, I work out after my daughter goes to bed (after 8 pm)!