Yes, you can cancel a non-refundable ticket on United Airlines, but you may not receive a cash refund. Instead, if you cancel after the 24-hour window, you are typically offered a flight credit, which can be used on future United flights. The value of the ticket will be saved for your next booking, minus any applicable fees, depending on the fare rules of your ticket.
In certain situations, such as a significant schedule change or an airline-initiated cancellation, you may be eligible for a refund, even for non-refundable tickets.