Tar has a long history in medicine for its use in the treatment of various skin conditions (source). Most popular is its use in the treatment of psoriasis (source), but its effectiveness for treatment of seborrheic dermatitis is also well documented. The most popular and widely available of the tars is coal tar, but other tars from more natural origins exist as well and have been used throughout history. This include tars such as pine tar and sulfonated shale oil.
Tar based products work mainly by slowing skin cell reproduction, normalizing the skin's inflammatory response mechanism, normalizing sebum production and killing off bacteria/fungi. The overall method in which the tars control seborrheic dermatitis seems to be very similar to that of zinc pyrithione.
Overall, tar products have proven to be safe for topical usage. Many of the producers of tar containing products (such as Neutrogena) conduct a fair amount of testing to ensure both quality and safety of their preparations. The natural alternatives don't have quite the same amount of research and testing behind them, but these have withstood the test of time. The most researched of the natural tar preparations appears to be sulfonated shale oil and research suggests less side effects when compared to coal tar (source).