Yes, it is legal. If you sell defective items, you may legally still be liable to issue a return, but if you choose to not issue returns, that is your choice. Note that it may affect customer acquisition, as this will look untrustworthy and too limiting to most consumers, especially when shopping online.
This article is not a substitute for professional legal advice. This article does not create an attorney-client relationship, nor is it a solicitation to offer legal advice.