foo is a metasyntactic variable: a word that does not mean anything by itself but is used to represent other, unspecified words.
In the NetHack community, people may refer to foocubus to represent a succubus or incubus, or footrice to refer to a chickatrice or cockatrice. To fooproof an object is to make it rustproof, fireproof or corrodeproof, depending on the object, but a better word to use in this case is fixed.
The word foo is used widely in the hacker (and NetHack-er) community, but it can be traced back to World War II and earlier. Its precise origin is not clear; RFC 3092 lists several plausible etymologies of the word.
NetHack players generally do not use bar, baz, and the rest of the common metasyntactic variables.