Yes, you can cancel your flight at the very last moment. However, different airlines have different policies, so you must go through them once. For most of the airlines you do not need to pay penalty for cancellations. If your reasons for cancellation are genuine then you can also ask for a refund. The airlines takes 7 business days to process the refund.