Yeah gross...I have seen this or something similar.
We had a cat years ago the lost hair around a spot that looked like a small hole, and when DH put pressure around it, a worm head popped up, when you would release, it would go back in.
It was worbal, livestock like cows and such get them. It was really disgusting.
Vet took it out and meds and she was fine.