Can a professor do an internship? Can a professor (let's say a math professor) do something like an internship at a tech company during the summer as a way to keep their industry skills sharp / relevant? Does anyone ever do this?

Perhaps the word "internship" is not quite right, but the idea would be to show up, be useful for 6 weeks or so, then go back to the university and teach students relevant real-world skills they'll need in industry.
Yes, but they are usually called "visiting researchers" or, in some cases, "residents", rather than "interns". See for example Facebook, Microsoft, or Google.