Tanzanian shilling is the official currency of the United Republic of Tanzania but the US dollar is ubiquitously used too. Other currencies such as euro, Pound Sterling, Swiss franc are not used in the payment but they always can be exchanged for shillings at a reduced rate at any exchange office.
Most of the hotels, restaurants and souvenir shops have prices in US dollars but you can pay by local shillings. In supermarkets with cash register you can pay by shillings or by credit card, the commission will be ~5%.
Arriving to Tanzania, you should be ready that the currency rate depends on value of the banknote, i.e. $100 and $50 banknotes will be changed at better rate than $5 and $10 banknotes. Exchange can be done in hotels, banks and exchange offices. It should be noted that the best exchanging rate is offered by exchange offices.