Background With the recent pandemic of the novel coronavirus disease (COVID-19), multiple sclerosis (MS) and neuromyelitis optica spectrum disorder (NMOSD) patients for their compromised immune system have been in significant concern. Awareness and attitude about this virus have an important impact on infection prevention and coping with stress and anxiety. So we conducted this study to assess knowledge, attitude, and mental health status in MS and NMOSD patients within the COVID-19 pandemic. Method In this cross-sectional study, the link of Depression Anxiety Stress Scales-21 (DASS-21) and a self-administered structured questionnaire were sent through social media to MS and NMOSD patients and two control groups consisting of healthy and migraine individuals. Results A total of 223 MS patients, 41 NMOSD, 29 migraine, and 245 healthy subjects participated in this study. MS patients had higher total DASS scores compared to healthy participants (p = 0.012). There were no significant differences among the study groups regarding knowledge and attitude. In MS patients, physical comorbidity was associated with a total score of attitude (OR 1.59, 95% CI 0.53, 2.66, p = 0.004). We did not find association between other demographic and clinical variables with DASS scores, attitude, and knowledge in MS patients. Conclusion The current data highlight the necessity of attitude, knowledge, and mental health assessment among MS and NMOSD patients. Further studies in other countries need to be carried to assess these points among MS and NMOSD patients.