Can being raped or having a miscarriage because of stress effect fertility?

Stress & fertility. Let me start by saying sorry for the pain you have endured. And yes, stress does create an environment for infertility. Here is how: after prolonged stress the adrenal glands begin to weaken, and their ability to make life saving hormones such as cortisol steadily diminish. In an effort to save your life, the adrenal will.
Rape potentially. Rape can be associated with sexually transmitted diseases that could impair your fertility. Miscarriage per se does not affect fertility, although some of its complications can (septic abortion, asherman's syndrome). Stress can decrease fertility in many ways.