Yes, you can cancel an order while it is in packed/shipped status, as long as the cancel option is available on app or website when you log in to your account. Simply navigate to 'My Orders' and select the order you want to cancel.
Any amount paid will be credited into the same payment mode using which the payment was made.