At my old church, which I attended before we moved, we had two services - an early one where people wore what they liked and the music was more modern, and a later service which was more formal - many of the men wore suits, the full chorus (dressed in robes) performed, etc. I loved this, but even in the informal service, no one wore PJs!
At the symphony, which we went to regularly in that town, most people dressed up to at least business casual level. Of course, all of this was before the pandemic and only Zoom meetings.
Despite what people think, it doesn't take money to dress a little bit better - I was a broke grad student at one point but I still managed a couple of nice outfits for church, interviews and the like. I bought stuff at Goodwill or Salvation Army. Lots of well off people donate nice, barely worn clothes. Even if you can only afford jeans, you can wash them (in your sink if you can't afford a laundromat) and be hygienic.
If you are homeless, then going to a musical is probably not on your radar... and churches will not have any issues about how you are dressed and, if they know your situation, will try to help. At least the decent churches would.