Yes, it is okay to change your programming language during the interview. However, make sure that you justify your decision to the interviewers. It is a good practice to think out loud during the interview so that the interviewers understand your thought process.