I would say that they can come into contact with anything because they are like air only slightly different.
Myrtle could touch the water, because she is like air.
Because of a literary inconsistency. Unlikely though.
I would say that they are like air, because clouds can touch water and contain it.
They could also have a invisible structure made of magic or some sort of fibers that hold them together. The framework could be like spiderwebs, only more sparse.
In passing through an object, they may impart a sensation of icy
coldness. However, they are apparently moved by gusts of wind, as
demonstrated when a petrified Nearly Headless Nick was wafted to the
Hospital Wing by a large fan, although this may have been possible due
to his petrified state.
If they are just air they would be able to be to be disintegrated, thus this suggests they have a magical framework, that can be strengthened through resolve and meanness.
Also, from the Peeves the Poltergeist example although not exactly a ghost, Peeves can touch objects. This is said because he is supposedly mean and that fuels them
So possibly Myrtles meanness makes her able to do such task.
From the wikia:
"A ghost, as I trust that you are all aware by now, is the imprint of
a departed soul left upon the earth... and of course, as Potter so
wisely tells us, transparent."
They pass through solid objects without damaging themselves or the
material, but create disturbances in water, fire and air. The
temperature drops in the immediate vicinity of a ghost. Their
appearance can also turn flames blue
These quotes show that ghost can have physical interactions. Another thought is that maybe she stays in the toilet because she can feel it.
Your question is related to this.
And this might help.
So from all of these sources.
Water affects them.
Nothing solid can be touched in most cases, and it can't hurt them. As Ginny threw a book at Myrtle and that just enraged her.
They can be blew by winds
The wikia said that they are affected by fire, but I don't see anything canon about this, but it does make sense if they are cold air.
They cannot die, a least it isn't know to my knowledge.
They can be petrified, and possibly affected by similar charms.
They can "touch" people and give them a cold sensation.
They can possibly taste and smell, as is demonstrated by the 2nd book, they molded and aged the food and "flew" through it to get the taste and/or smell.
They can provide magical interference since Sir Nicholas saved a student by being there in front of him to stop him from seeing the Basilisk directly.