House drew a lot of inspiration from Sherlock Holmes - both get cases nobody else can solve, Wilson / Watson are their close companion who are essential to solving many cases, etc. It's something acknowledged in interviews by people involved in the show.
The drug use is another thing - Sherlock used cocaine and morphine. House used Vicodin. Morphine and Vicodin are both opioids.
If they had him abuse cocaine, it would be too unrealistic. If they had him abuse Adderall, it might not be obvious to audiences that he has a substance abuse problem - people could write it off as him using it to focus. A prescription opioid is something audiences understood were abused at the time, and maintains the Sherlock connections the writers were going for.
Plus it gives plenty of plot hooks to explore the effects and consequences of addiction to someone we believe to be very successful (success is happiness, right?) in season 1
Sherlock Holmes did not use opium. Watson once described him as appearing as someone under the influence of opium, but discarded the suggestion. In another story ( The Man with the Twisted Lip ) Watson discovers Holmes in an Opium den, but Holmes is on a case and in disguised.
The cocaine habit is probably exaggerated. Watson does not give a frequency of his usage and reports Holmes as saying that he only uses it when he doesn't have a case to occupy his mind. Whether this means he uses it a few times a week or a few times a year is not stated.
It's strongly implied that Holmes used morphine for recreation as well by the fact that Watson had to ask which habit he was indulging in The Sign of the Four.
"Which is it today," I asked, "morphine or cocaine?"
"It Is cocaine," he said, "a seven-percent solution. Would you care to try it?..."
"Your teeth look good, have you made any diet changes?" - Dentist
"Yeah, I don't eat poppy seed bagels anymore, don't want to lose my job. Oh, and no novacaine, same reason. Just get started until I pass out from the pain."
There's a huge difference between popping pills and having a local anesthetic. To even attempt to compare the two is being disingenuous at best. It's not even something prescribed to take home.