Yes, I would definitely call the vet. And in future, never pull on anything sticking out of your dog's anus. Cut it instead so it's not hanging, but never pull.
The rug he ate could cause or already be causing a gastrointestinal blockage, which can be fatal if not treated immediately. Also, when you pulled the "rope" out, it could have caused intestinal tearing.
If this ever happens again, NEVER pull out anything sticking our of your dogs anus, as doing this can cause tearing internally. If there is tearing internally, all the bacteria in the intestines are let loose into the dog's blood stream. There is so much harmful stuff in there that it poisons the dogs blood, causing sepsis, and is often fatal, especially if not treated immediately. If this ever happens again, just cut the rope or whatever is sticking out of his anus.
A gastrointestinal obstruction is basically a blockage in the digestive system. Foreign objects like rugs, sticks, or cloth often cannot be digested and broken down, so they get stuck in the dog's digestive system. This can either stop their digestive system, or cause internal tearing, which causes sepsis like I discussed. Either requires immediate medical intervention, usually surgery to immediately remove the object.
Sometimes dogs can pass these object through their digestive system, but sometimes they can not, and can often be fatal if not diagnosed quickly. So maybe your neighbor's Great Dane eats socks all the time without a problem. But sometimes things are not so lucky. Only a vet can tell you whether your dog is passing or has passed all the foreign material, or whether their is a blockage that requires immediate surgery.
And maybe pulling on the rope didn't tear his intestines, but maybe it did. Only a vet can tell you.
That is why it's very important in this case to see a vet. They can tell you whether all is well, or whether your dog needs immediate intervention to save his life.
If your dog stops eating or pooping, or seems to be pain, especially abdominal pain, or if your dog becomes lethargic, or seems withdrawn or whines or cries he needs to be rushed to the emergency vet. DO NOT wait for this to happen though. At that point, it can be too late. So please take to be seen now!