Is pooping in the squatting position (instead of sitting) a way to treat or prevent hemorrhoids?

Theoretically. The buttocks rest on the seat and the entire pressure of any straining is directly on the anus and the hemorrhoids. While squatting the pressure would be equalized to the entire area. It is not considered an important treatment mnodality and is unklikely to help someone with hemorrhoids. Hight water and fiber intake with taake care of them the majority of times.
Not position. This is the disease of erect two legged homo sapiens ( humans ) four legged animals do not suffer with this disease. What position you defecate is not the answer to prevent hemorhroids, but proper high fiber diet, regular bowel habits, plenty of fluid intake and to prevent constipation.Aware of this month for colon cancer prevention month, make sure you have colonoscopy.