Depends on how you do it. The general
answer is no and it is a high risk if done if not done correctly. The danger is having the exhaust from one device come out thru the other device. If you can get
enough draft from either device.(ie lots of waste heat up the chimney it can be safe) They used to do it with chimneys and fireplaces. But even there the normal best answer was keeping the flues separate but running them all inside a single chimney.
If you are going to do it you need a diverter valve that seals tight and a way to interlock it so you NEVER try to run the given device without a clear path out. It
should never depend on humans NOT making mistakes as that will eventually kill someone. If you do it be sure you add a CO detector that will warn you when you have screwed up. Good idea anyway.
Country oriented nerd with primary interests in alternate energy in particular solar. Dabble in gardening, trees, cob, soil building and a host of others.