This depends on the degree earned and the institution granting it. It’s a good idea to investigate the school’s accreditation. Schools with regional accreditation are considered the most trustworthy, and some schools may also be accredited by the National Association of Schools of Music (NASM).
In general, while online degrees are considered less rigorous and therefore less credible, this doesn’t mean they are worthless. Since it’s what you learn that really matters, if you are a capable online learner you should come away with good preparation for a music career. An online degree from a highly reputable institution (like those listed here below) might be perceived as being more valuable than an in-person degree from a lesser-known school.
Not everyone is good at online learning, so some students will be better served by studying in person on campus, or perhaps studying in a hybrid model (with some courses taken online and others in person). If the school has a strong reputation, the online degree could be considered an excellent credential.