Yes, by definition (and according to the ADA Code of Ethics), general dentists can perform ANY procedure they wish, as long as they perform it with the same expertise that a specialist would.
Therefore, if a general dentist is comfortable doing Endo, and (most likely) has obtained a plethora of continuing education in Endo, they are more than able to complete those procedures.
If, however, the general dentist is confronted with a procedure which they believe is so difficult that they are NOT able to provide the patient with the same level of treatment that would be provided by a licensed Endodontist, that general dentist should then refer the patient to a specialist.
Also, a specialist (say an Endodontist), is NOT ethically able to perform procedures that would be handled by any other specialty OR by a general dentist.
This plays out in several ways: 1) General dentists, although able to perform a wide array of procedures, most commonly leave the extremely difficult cases (and often only mildly difficult cases) for their specialist counterparts. Time is money in the office, and a specialist might be able to do the procedure 2-3x quicker than a general dentist, while the GD could see 3-4 patients in that same timespan rather than the single patient. In 99% of the cases, referalls to specialists are best for BOTH dentists. 2) Part of specializing is the realization that a) you can not do general dental procedures and b) that when the really tough cases come along, you have nobody to refer them out to. 3) Because of #2, refering is an important part of our profession. Building a network of fellow dentists helps keep the profession alive and builds the income of all parties involved. GDs will send plenty of cases toward the specialists, and when the specialists are confronted with new patients who want general treatments, they will kindly point them in the direction of the GD.
I hope this rambling answered some questions.