It’s not a universal policy so you need to check the terms before you buy your ticket. Many (non-US) airlines will say that you cannot cancel the ticket and get a refund. Therefore, if you need to cancel you lose the value of the flight unless you can negotiate with the airline a change in date or time (usually pay a penalty). The best thing you can do is buy a travel insurance policy with trip cancellation. If you need to cancel a flight for a covered reason, you can get your money back.