If their legs are on the outside, which seems to be the common position, I close my legs together. I am very short and doggy is generally painful for me because they hit my cervix, especially larger cocks. I find by closing my legs, it stops them going in so deep. Sucks for them most likely but I wont be in pain for any amount of money.
If they are too large, I just wont do doggy. Some of them are well aware they are hitting me and go "ohhh what's that in there". I reply rather flatly, "that would be my cervix, and it's rather painful".