Termux has nginx, postgres, python and plenty of stuff compiled to ARM so I bet you can. You would have to be wary of non standard ports unless you have root access and make sure android does not kill or puts to sleep termux by adding exceptions to the app.
I remember running a few low traffic Mastodon bots in a S3 Mini years ago and it was decent.