Will an Ultegra bar end shifter work with MTB derailleurs?
Most Shimano components are compatible with the Ultrega and Dura Ace bar end shifters, so long as they are specifically for 8 speed or 9 speed systems (you can use a 9 speed shifter on a 7 or 8 speed cassette, but not the other way around). If you're fussy about indexing, it may take some adjustment, but friction shifting is fast, reliable, and cheap! (If I remember correctly Ultrega and some of the Dura Aces have a friction option, while a few Dura Ace models have only indexing). You will run into issues with 10 speed Shimano bar end shifters, especially with the front derailleurs. (Make sure that the shifter is compatible with triple cranks if you have a triple.)

Sram mountain derailleurs, however, DO NOT work with most bar end shifters! I've never actually tried it, but I've read in numerous places that they are not compatible (even with Sram bar end shifters).

Additionally, there are numerous other manufacturers of bar end shifters (Rivendell Silver Shifters, for one). Many different mounting options exist, including Paul Thumbies, which allow shifter levers to be mounted on top of the bar, as well as a bracket by IRD for mounting to the stem.

Here, again, be aware that road handlebars have a larger ID than mountain handlebars. A bar end shifter made for road bars will not fit inside of a mountain-specific bar.