Can you wear pantyhose instead of compressions stockings?

Not if want results. If your physician has prescribed compression stockings for you for a particular condition, then you require a certain level of pressure, measured in mmhg, to meet that goal. Unfortunately, regular pantyhose, and even over the counter "support" stockings do not meet these levels of compression, and will not provide the necessary effect.
Doesn't solve issue. If you require support stockings then pantyhose do not replace that. Support pantyhose are available and are especially used during pregnancy. As far as compression is concerned, most of the time to the knee is sufficient since the majority of compression occurs with the calf muscles. There are occasional patients who require thigh compression and even less that need it to the belly button.
Compression panty- Hose are also made. If your doctor has told you that you need compression and you prefer to wear pantyhose, they are readily available in multiple colors and amounts of shearness from your local durable medical supplier.
Compression stocking. The real issue here is the level of compression that is needed to treat the underlying condition. Over the counter 'panty hose' stockings usually do not have the level of compression that is needed if your doctor has prescribed compression for you. With that said, many of the prescription grade stocking lines make products that are medically effective and cosmetically tolerable.
Compression. Compression stockings are graduated with higher pressure at the ankle and the pressure drops as the stocking continues up the calf Pantyhose is ok, in length, as long they are termed support or comptression, regular pantyhose will not accomplish that,