Banks are now more or less everywhere in Tajikistan and, proving they have sufficient cash behind the counter, all of them will change dollars and roubles. If you have another currency it is still worth asking, for if I hey cannot do it they may still be able to summon someone from the bazaar to change it for you.
Dushanbe and the larger cities also have a number of money-change booths: you'll recognise them by the boards outside advertising their current buy and sell rates for various currencies. Their rates may be incrementally better than in the hanks, but there's not a great deal in it.
Tajikistan's money changers are less fussy than others in the region, but to avoid hassle at an inconvenient moment you should keep your foreign notes clean, unfolded and uncreased. Flattening them inside a book may help. If there are any marks on the notes, including ink stamps from where they have been counted in a bank, they may be rejected. High-denomination bills are preferred, as are US dollars printed since 2006.