It is absolutely possible, but you probably won't be doing much else with it.
You're going to need a very specific phone. I actually tried doing this with an old blackberry phone I had, but even though I could run a Linux command prompt, I didn't have systemd or any other startup method so I wasn't able to run Apache or a copy of Lemmy as a service.
I have a pinephone, and that would be super easy to run with I believe, because it's just Debian -- and you can run Lemmy on Debian no problem. Thing is, at that point it's more just a computer running on phone hardware rather than your phone in the way that you're thinking.
I still believe that there is a way to be able to run let me in a Linux container on an Android phone, but there's such a thing as personal bandwidth and so I just haven't gotten around to try.