How do Chinese students write words whose characters they haven't learned?
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 '渾蛋'