My grandma told me it's not nice to sit with my legs stretched out facing the the family altar.
この場合、次のように言うと良いでしょう。
ーMy grandma told me it's not nice to sit with my legs stretched out facing the the family altar.
「祖母に仏壇に足を向けて座るのは良くないと言われた」
to sit with one's legs stretched out facing the the family altar で「仏壇に足を向けて座る」
ーMy grandma told me not to sleep with my legs pointed towards the family shrine.
「祖母に仏壇に足を向けて寝てはいけないと言われた」
to sleep with my legs pointed towards the family shrine で「仏壇に足を向けて寝る」
ご参考まで!