I have not heard of any sexually transmitted infections (STI) passing this way.
The main thing would be if you come in contact with any fluid that could have an infection in them like blood or vaginal fluids.
I think it also depends on how big the panties are, if the covering is like the thickness of string it would probably be similar to performing DATY on someone.