Scientifically speaking, there are no studies to back this. Dogs are known to sense pregnancy in humans even before the diagnosis. It is quite natural for your dog to feel the physical and emotional changes your body goes through when you become pregnant, even before you know it.  Dogs are sensitive creatures, and if they can sense your pregnancy, they can also sense miscarriage. If your dog becomes protective of you more than usual, it can mean that they are trying to show affection to you, maybe because you are pregnant or because they want to ease your pain.  After all, they already know that you would be having a miscarriage. However, you must understand that there are no scientific studies that back this up, so it is a conjecture for now.