If someone already trademarked the quote, using it can result in an infringement lawsuit. If the quote belongs to the public domain, you can put it on a shirt for commercial purposes. To make sure the quote is usable, check with the USPTO Trademark Electronic Search System and consult an intellectual rights attorney.