I don't know if it just depends on the school, but you definitely can. My undergrad was in IT, and for a while I was in a Master's program in psychology (big mistake). One of my computer science professors predictably had his master's in computer science, but his undergrad was economics.