Actually, the most natural way to say that would be "Il y a du fromage dans le sandwich".
"Ce sandwich contient du fromage" is typically the kind of sentence you'd read on a nutrition label for instance, like "Ce plat contient du gluten / du lactose / des noix / etc.". Very formal, as you apparently know it.
"Le sandwich a du fromage"... mmh, grammatically correct, but it sounds weird, really. The "there is... in..." form is the most common and natural.
You mean, saying "It's a cheese sandwich" ? Yes, probably. But then even in French, nobody would say "Le sandwich contient du fromage" just to express what kind of sandwich it is. That sentence would be used to specify what is inside, kind of to "warn" the person in case of possible intolerance or allergies, you know.
The most simple way, and equivalent to "It's a cheese sandwich", is "C'est un sandwich au fromage".
The au (or à la, etc.) is sometimes skipped - mainly on menus, but sometimes also when speaking:
- J'aimerais un [sandwich] jambon-fromage s'il vous plaît = I'd like a cheese-ham [sandwich].
As you can see, we sometimes even skip the word "sandwich". But that works only with compound names ("un poulet curry", "un scampi à l'ail", "un thon piquant", etc.); nobody would say "j'aimerais un fromage" referring to a cheese sandwich (that would simply mean "I'd like a cheese").