How do Chinese students write words whose characters they haven't learned? To clarify, I mean Chinese schoolchildren who may, for whatever reason, need to express a word that they haven't learned the character for, e.g., 餐 in 晚餐.

Would they use pinyin, like 晚cān, or substitute another character in, like 晚参?
If a person didn't know, or forgot how to write 餐 in  晚餐, he would not knowingly use a wrong word for substitute. The first thing he would do is to ask people who know. 

If there's no one to ask, he would substitute 晚餐 with a synonym that he did know is correct. For example '晚飯'.

If he can't think of a synonym, he would use pinyin 'cān' inplace of the actual character '餐' and write '晚 (cān)'.

If he didn't even know the pinyin, then he would leave it blank with a question mark  like so: '晚(?)'

Sometimes, people knowingly use similar sounding words instead of the correct ones for humor effect. For example, '神馬' instead of '什麼' ; '魂淡' instead of '渾蛋'