Can internal medicine doctors perform surgery?
The answer hinges on your definition of two words: "allowed" and "surgery".
The concept of being "allowed" has 5 aspects: legal before, legal after (malpractice), institutional, ethical, and practical.
Legal "before": Legally, in the US, a physician's license to practice is unrestricted, meaning that he or she can do essentially anything medically-related to a patient, as long as the patient consents. So, legally, if a patient agreed, I, as an internal medicine doctor, could legally perform any surgery on that patient (for this example, let's take a surgery that I'm NOT trained in, like gallbladder removal).
Legal "after": However, in the above case, if anything went wrong, I would be legally liable for practicing outside my area of expertise, especially since here in Austin, there are plenty of good surgeons with appropriate training. If anything bad happens (even if it would have happened to a surgeon as well), I would have a very high likelihood of losing a lawsuit if it were brought against me. There would be a legitimate lawsuit that I had taken on a task beyond my capabilities and training and that the patient had been harmed as a result. If the patient did not have any harm, however, then no lawsuit could be launched.
Institutional: To prevent the problems with legal "after", hospitals and other institutions have review boards that review information about doctors' experience levels and training, and then grant each doctor (on a case-by-case basis) "privileges" to perform certain aspects of medicine and surgery at the facilities in their control. For instance, I am trained to manage a ventilator, and I do it all the time at small hospitals, because they give me that 'privilege' (because there is no intensivist available in small towns). At larger, more urban hospitals, an intensivist is available 24/7, and those hospitals often will not give me privileges for ventilator management, despite my experience, because a specialist is available to do that work, and he has more experience. So, even though I have the legal ability, and the training/experience, I am not allowed to perform that aspect of medical care because the institution will not allow it.
Ethical: If there were an unavoidable situation where for some reason I had to perform surgery, perhaps I could justify that to myself. But, if there were any chance for a patient to see an actual surgeon, it would be unethical of me to try to take care of the patient. This is where "House MD" becomes really problematic. Multiple studies have shown that the rate of surgical complications goes up dramatically with less experienced surgeons, and decreases with practice. For instance, for 'surgeries' that I'm "allowed" to perform at a hospital, they always check to make sure that I've done at least 5-10 in the last 2 years. They check because even if I've had the training and experience, skills can fade without a baseline level of practice. So, if I were to act like House (or his fellows) and try to do everything myself, I would ethically be giving my patient a lower level of care than if I were to ask an experienced surgeon to do those surgeries. It would be like deliberately prescribing a drug with more side effects instead of another drug with less side effects, for no reason - I could not ethically "allow" myself to go through with it (though it does make for a smoother story, since the show doesn't have to introduce new characters every time the story calls for the patient to have a surgery).
Practical: This is related to the ethical point, but after training in Internal Medicine, there isn't really any great way to get surgical training. Unless I wanted to go back and do a surgical residency, I really couldn't achieve the skill set needed to do intra-abdominal surgeries. I could read books, but there is a LONG, LONG way from reading a book about a surgery to being able to consistently perform that surgey safely. There is no way that House's fellows could achieve or maintain the necessary level of skill and experience in all of the surgeries and procedures that they supposedly are performing.
The last point is related to which definition of "surgery" you are using. Most non-physicians use the word "surgery" to mean "major surgery", meaning intra-abdominal (belly), intra-thoracic (chest), or intra-cranial (head) surgery, or bone (orthopedic) surgery.
"Minor" surgery and "procedures" are technically also surgeries, according to the law and physicians, but that includes things that most non-physicians don't think of, like abscess drainage, skin biopsy, lipoma removal. etc., as well as "procedures" like central line placement, thoracentesis, paracentesis, chest tube placement, lumbar puncture.
As an internal medicine doctor (especially as a hospitalist), I do all of those procedures and more. They are technically surgeries and I am "allowed" to do them under all 5 of the criteria above. But it's not what most people think of as "surgery" and it's not what is shown on House.
(btw, I'm actually in the minority of doctors because I LOVE House. I don't think that the epitomy of medical storytelling is "realism" - I think that "House MD" explores some fantastically important and interesting themes, dilemmas, and experiences in medicine, and it does so in a way that is both challenging and interesting. Like all good art/fiction, it serves a greater "truth" than accurate reproduction of reality).