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.