is it legal to buy a pipe online?!
Yes, it is.
As long as local laws say so. If you can buy them at head shops or other places near you, then it's okay to buy them online.
The pipe is legal, what you smoke in it... is your own business.
Paraphernalia is paraphernalia. Where you live determines not only what you can own legally but also how severe penalties may be for carrying it.