Short answer, yes. Long answer, yes but with huge qualifiers.
My last relationship was with someone who had very severe problems with a mental illness that was poorly managed and caused an extreme level of stress in those around her. It sucked two years of my life away trying to deal with it and it took A LOT away from me, negatively effected my own mental health, and is still an ongoing problem.
On that basis, I would be extremely hesitant to get into a relationship with someone who had some form of mental illness.
That said, a quarter of the US population has some kind of mental illness and with proper management and care, it doesn't have to be a major issue.