Fasting, praying and eating according to religious rules is impossible in some jails, ex-prisoners and groups say.