Your feet sweat, just like the rest of you does.
Sweat itself is normally odorless, but it contains nutrients for bacteria, and provides a nice warm moist place for them to live.
Sweat contains amino acids and proteins (which are made of amino acids). Bacteria can break these down into simpler molecules as they eat them. One of the simpler molecules is propionic acid.
Propionic acid has the same structure as the acetic acid in vinegar, except it has an extra carbon atom added on the left side. It has a strong vinegary odor.
Another similar breakdown product of amino acids by bacteria is isovaleric acid. It also has a strong smell, and it is one of the molecules bacteria produce when they break down amino acids during the manufacture of cheese. This molecule is one of the main contributors to the aroma of cheese.
So if your socks smell faintly of vinegar or cheese, you can blame the bacteria we use to make vinegar and cheese. They are at work in your shoes.