They don't have to be new or sealed but IMHO it helps if the oz are marked on the container.
For the most part you will be fine filling the generic travel size bottles but if you can find them with the oz markings you know you will be fine. Some TSA agents want to see the oz marked clearly on the bottle others don't bother.
I usually re-use the travel size bottles because they are clearly marked as to what they are and the oz. Even if it isn't the same shampoo I put my shampoo in a travel size shampoo bottle, conditioner etc.