Mambo rafiki! I think this is called substitution, where "the shirt" and "it" are the same thing. So, it is grammatically correct, and perfectly understood in English.
The shirt is small, (and) it (the shirt) cannot be worn.
I hope it helps. :)
Should this read, "The small shirt cannot be worn"? Or is it simply two sentences?