The most common reason for blood in the stool is parasites such as worms or a protozoan infection such as coccidia or giardia. The most common worms found in dogs are: Roundworms, Hookworms, Tapeworms, and Whipworms and Heartworms
In some cases these worms are passed from the dog to dog, in other cases such as tapeworms, they are contracted by other methods such as ingesting an infected flea. Most over the counter medicine will only kill one or two types of worms, so your best bet is to take a fecal sample to your vet to determine the type of worms your dog may have and then decide on treatment. Dogs should be checked for worms periodically even if they appear healthy. This is so if your pet does become ill, you are not fighting a worm infestation along with a more serious problem.
For additional information about worms, see this site
Common dewormers are Panacur, which is a prescription product so you need to obtain it from your Vet and it works on roundworms and whipworms. Wormers labeled as Pyrantel Pamoate are the best over the counter medication for roundworms. Drontal plus is also a prescription product and is used for the treatment of Tapeworms, though dewormers with praziquantel work well against tapeworms. Many heartworm preventatives also help control whipworms and roundworms. Another reason to keep your dog on Heartworm medication.
Coccidia manifests as mild or severe diarrhea depending on how infected they are. If it is severe, there may be blood and mucous in the stool along with voming and loss of appetitie leading to dehydration You can read about it here:
Information on giardia
Symptoms of giardia are diarrhea with possible terrible smell, mucousy stool and sometimes bouts of vomiting.
Other causes could be anal growths, infected anal glands and inflammation within the large intestine. You can read about the various cause of red blood in the stool here:
Now since your dog is scooting, the anal glands could be an issue, though diarrhea will often lead to anal gland issues, so I'd get the dog's anal glands emptied either by your vet or a groomer and treat for parasites as a first step as slong as your dog is eating and drinking normally.
I hope this information is helpful to you. If you would like any additional information or have more questions please don’t hesitate to press the reply to expert or continue conversation button so I can address any issues you still have . If you do find this helpful, please take this opportunity to rate my answer positively so I am compensated for my time.