No it is illegal to order narcotics over the Internet. Speak with your Doctor and let him know your having trouble and see what options he can offer.
It's pretty near impossible to get actual Vicodin from the internet. What you will most likely get is a pill made on dirty equipment somewhere in Mexico or Vietnam or somewhere like that. The chances of that being US prescription grade Vicodin is slim to none. If you do order them online than you will either get ripped off, them stealing your money with no product. Or it may get caught in customs. The first time they keep the stuff and send you a letter. The second time you get more than a letter.
Just understand that unless you have a lab and can test the pill to find out what it really is, it's very bad to take an unknown pill from an unknown source. God knows what they could put in there. Usually it's just enough hydro to make you think it's real but also contains other dangerous fillers.
Don't do it!! Not only is it DANGEROUS (you'll never know if what you're really getting IS vicodin), but it is ILLEGAL!!
My suggestion instead is, talk to your doctor and tell him that the amount of vicodin that he is currently prescribing is not enough to take care of your pain and ask him if there is anything else that he could give you instead. There are many other pain meds out there that may work better than the vicodin does for your pain without you having to resort to an illegal and dangerous act of ordering off the internet. Perhaps going on a long acting med with perhaps the vicodin for breakthrough pain would work a lot better for you. I personally wouldn't recommend going into the appointment with your doctor asking for SPECIFIC meds, but rather ask him what else there might be available for you to try and see if it helps better.
Best of luck and PLEASE, do not even consider doing what your friend has done.