Can I use PVC pipes for the rib on the wings of my homemade airplane?
Yes, of course you can.

However, it's probably not a very good idea. 

PVC pipes are pretty strong and light; circular-section PVC pipes have an excellent strength-to-weight ratio.

Being strong and light isn't enough though. Construction materials need to have the appropriate properties (like being strong and light) in the right conditions. 

In the case of an aeroplane wing, that includes the conditions that aeroplane wings are subjected to: rapidly-changing stresses, vibration, sustained load, torsion and so on. You need to know: will PVC remain strong under such conditions?

Then presumably, you will need to find various ways of joining your PVC sections to each other and to other materials. How will these joins be made? How will they behave under the conditions an aeroplane wing is subjected to? How will the joining methods affect the properties of the PVC pipes?

Aircraft designers tend towards the conservative; even the most radical of aircraft designers would not be considered daring compared to the radical leaps taken by designers in other fields. That's because the chief reward for brave leaps in aviation is death.

All the same, over its history, aviation has tried all kinds of things (usually, quite carefully). If aviation has successfully used PVC pipes in aircraft construction, there'll be a record of it and a tradition of it. The successful pioneers of PVC-pipe-based aviation will not, however, have embarked on their adventures on the basis of an encouraging Stack Exchange reply.

If you don't already know the answers to the questions I mentioned above, and are not already in possession of reliable information about techniques, tools, practices and theory for working safely with PVC load-bearing structures, I'd prefer to use PVC pipes for plumbing only.