When I graduated from Vet School, in 92, it was pretty common for clients to come in for a "mis-mate shot". I don't remember which hormone it was, but it was a hormonal injection that significantly reduced the chance of pregnancy. The area, where I worked, had a lot of breeders nearby, and they would have instances where their breeding animals hooked up with the wrong partner.
But, I haven't worked in an area like that (breeder heavy) for over 20 years, and haven't ever needed anything like that. Pretty sure there is not a pill, but you might check with your Vet to see if he/she can help you.
While I don't work on dogs, this is a FAQ I get from many ranchers. Sadly, it is very difficult to abort dogs. It makes them super sick and they need to be hospitalized for a couple days. Honestly, it is cheaper, easier, and much safer to have your dog spayed. If you don't want to go that route, wait about 30 days and have her ultrasounded for pregnancy diagnosis. Hopefully she will not be bred and the ordeal is over.