edited: turns out this info was for cats. I don't know if it is different for dogs -- I am going to keep looking a few more minutes.
It could be an anal or a rectum prolapse. If it's an anal prolapse, it will probably be just a very small amount of red protuding and yes you need to see a vet to confirm the cause as to whether it is parasitic, infectious, or dietary in nature.
If there is more tissue protuding (like a tube of tissue), then it could be a rectum prolapse and you need to see a vet right away since this is life threatening b/c if there is much tissue protuding, then that rectum tissue will die, causing the animal to die. If there is much tissue protuding, then call the vet you are familiar with and tell them what it is and see if they can't fit you in and what advice. I don't have any personal experience with this, and I didn't read the time frame involved before needing to get the tissue back in.
Here is a site with more info:
More reading I found that actual rectum prolapse (where tissue is protuding) is rare in dogs, but usually felt to be caused by parasites when it does happen. Dogs do not get hemorrhoids, so if any tissue is actually protruding out of the rectum (versus the rectum area being swollen), then it is important to see a vet quickly. Keep the area wet with a warm washcloth and do not let the dog lick it. Keeping the tissues moist will help to keep it alive.
Having said all that, it is probably either an anal prolapse (not as life threatening) or some type of abcess. Still important to see the vet as soon as you can.
I didn't say all that above to scare you, I think it is unlikely that it is the serious version; however, just in the rare case it was, I needed to mention it so if you really did see actual tissue sticking out you would know to get to the vet right away versus waiting till tonight or tomorrow.