Hoods are used to keep extraneous light from entering the lens resulting in flare. A secondary function of hoods is protection from being dropped or knocked.
UV filters are used to eliminate UV from entering the lens. These apparently have little effect on digital sensors, more so with film (as I don't know the precise technical reasons for this I will not postulate further). A secondary function is protection if there are any object(s) coming into close contact with the front element - this could be grit, water, kids fingers etc.
Hoods are universally accepted as being beneficial without detriment to image quality.
UV filters are never accepted as being beneficial to image quality - to what degree is another argument.
Hoods only typically fit the lens they are designed for, yes there are some overlaps 10-22 & 17-40 are two that spring to mind.*
UV filters fit any lens with the same filter thread size.*
*EDIT - Canon consumer lenses aren't supplied with hoods therefore the last two points are arguably more relevant to them with regards to the secondary functions.