Yep, you’re right, the words “Foo” and “Bar” are used as a convention, they’re used to indicate something in the programming world.
As you said, it’s just a placeholder, a common one in programming to indicate something in a code example.
Initially I had assumed it referred to the FUBAR acronym as popularized in the movie Full Metal Jacket. I’ve known other professionals who have made that assumption. But it seems that the actual history is more complex and interesting: