Question: "Is it better to buy accessories for an item from the manufacturer of the product or from a third party?"
Answer: (as is often with me) It depends.
In some cases, going with third-party accessories might actually make more sense than going with the factory items, but in other cases, it's worth it to pay more and get quality stuff.
For instance, official Nintendo Gamecube controllers are supposed to be better built than off-brand ones, and judging by my experience with third-party N64 controllers which broke (the official ones are still around), that's probably true.
Canon has accessories for their lenses that are usually expensive...here's what I think about considering them if you have a Canon DSLR (I plan to stick with Canon lenses mainly because of my familiarity with them and possible compatibility issues I've heard about):
1) If there doesn't appear to be any difference in performance or a third-party accessory is better and it's compatible, it might be a good idea to go with it, rather than using the factory item. For instance, batteries and battery grips from third-party manufacturers sometimes have good reputations and are often cheaper than Canon's, and I've read that there are third-party external flashes that
2) I used to think that lens hoods were just pieces of plastic, so why buy Canon's? However, I found that Canon's lens hoods (Canon is stingy, BTW, and makes you buy lenses and lens hoods for non-L lenses - they don't come included) have felt or some other black material on the inside of them to block light. Also, they're probably better built, can be mounted backwards (at least with some lenses) unlike screw-on hoods, and third-party lens hoods might cause vignetting or not block enough light at certain (or any) focal lengths.
However, any lens hood should provide a minimal amount of protection in the event that you drop a lens on its face.
3) As far as I can tell, Canon's lens caps aren't special; other than the words on the front (i.e. Canon, and Ultrasonic, like on my EF-S 10-22mm f/3.5-4.5) and matching color in the case of the gray L super telephoto lenses, I don't see why you'd want to get the official Canon ones.
In fact, I've read that some Canon owners actually used Nikon lens caps for the center-squeeze attachment device.
OK, that's all for now. Congratulations, you've just wasted three perfectly good minutes (or however long it took you to read this).
For all you photographers reading this (if you are), here's something that will interest you slightly more...or not.
Behold, the moon: