Both versions of the sentence are grammatically correct, but they have slightly different meanings.
"I'm having a foot surgery tomorrow" suggests that you are having a specific surgery on your foot, perhaps one that you have previously discussed or scheduled with someone.
"I'm having foot surgery tomorrow" suggests that you are having some type of surgery on your foot, but the specific details may not be as important or may not have been previously discussed.
In general, if you are referring to a specific surgery, it is more common to use the article "a" before the noun. However, if you are talking about a general type of surgery, you can use the noun without an article.