There is a disease Hematochezia. It causes bright red, fresh blood in the excretions. If your pet is old then it can be cancer but in younger pets like, it is caused due to parasites. So you may be right about worms. If it is occurred once then it means it is due to some minor problem, which can be healed automatically due to internal immune system, but if it occurs again that indicates some serious problem. Change its diet and then note the results. Give it medicines to kill these worms inside its intestine.
Typically, blood in the stools is a sign of worms. There are several over the counter wormers available or you can get one from your vet. If the blood does not go away after a complete worming there may be a more serious cause.