Can I wish my students all the best in the mid-term exam paper?
As a student, I'd appreciate my professor wishing me the best for the exam. 

If I were to make a suggestion though, it'd be better to write "All the best" at the start of the paper, right after the general instructions section. 

Even better if you could drop in before the start of the exam and wish the students in person.