Yes, it is possible to cancel the delivery challan even if sales order has already been recorded.
Record a sales order:
Record a delivery note by selecting the order number from the sales order recorded above.
Select the tracking number and order number.
Complete the transaction.
Record the delivery note for goods returned by entering the quantity with a negative sign.
Select the tracking number and order number.
Complete the transaction.
Now check the sales bill pending report. The quantity entered in negative will appear.