Yes. Onward tickets are legal as they come with a PNR number that can be verified on the airline website. Keep in mind that onward tickets do not have an e-ticket number like a fully-paid ticket has.