Tar is one of the poisonous substances contained in tobacco.
PHRASE
被當作一丘之貉;被當成一路貨色
If some people in a group behave badly and if people then wrongly think that all of the group is equally bad, you can say that the whole group is tarred with the same brush .