A foam is just a liquid with plenty of air incorporated into it. You can incorporate air into any liquid; in order to be able to create an actual foam, however, you need to be able to incorporate the air faster than it escapes.
What makes a liquid able to hold the air you're incorporating (and hence form a foam) is a foam stabilizer, also commonly called an emulsifier1. I know of no specific taxonomy of stabilizers, but the vast majority are hydrocolloids AKA gelling agents and belong to some family of protein.
- Agar, carrageenan, alginate, xanthan, and pectin are all types of polysaccharide;
- Lecithin is mostly a random collection of phospholipids;
- Gelatin is denatured collagen, i.e. animal protein;
- Whey protein is the prevalent protein in dairy products;
And so on. Really almost any emulsifier will do. Basically everything in your list either is, or contains, one of the the additives mentioned above:
- Chocolate is almost always emulsified with soy lecithin;
- Eggs contain high amounts of lecithin;
- Milk and cream contain whey protein;
- Most "supermarket cream" also has emulsifiers like carrageenan already in it.
...you get the picture, I hope. The most basic answer I can give to this is that if you want to make a foam, you need to either use something that's already an emulsion (milk, butter, chocolate, etc.) or use an emulsifier/stabilizer additive (such as gelatin, lecithin, etc.)
If you want a relatively complete list of all of the food additives that qualify, you'll want to look at the E number, and specifically E400-499 (thickeners, stabilizers, emulsifiers).
1. As commenter Erik very correctly points out, an emulsifier is not the same thing as a foam stabilizer. However, by convention, the terms seem to be used interchangeably all over the place, to the extent that I get blank looks when I refer to a "stabilizer" as opposed to "emulsifier". So, know the difference, but don't get too hung up on it.