I had this problem once (at least I think it was glue?). Anyways there was what looked like glue in one of my pony's hair.
I washed the piece of hair with the glue over and over in hot water (out of the tap) and used a little dish soap. Then between washing the hair I tried to pick at the glue and it started crumbling off eventually. Eventually I could comb through it again, and now there are no traces of that glue or glue-like substance anymore. You may want to try some conditioner too.
Good luck, and I hope something works out for you.