Who pilots an aircraft that is on a delivery flight?
Typically the customer will travel to the manufacturers location for a final inspection and acceptance of the new aircraft. This includes one or several test flights with staff of both the manufacturer and the customer on board, thorough systems checking and final modifications if necessary. The acceptance of the aircraft is then made official by signing off a pack of papers. 

Then the customer transfers the final sum of money to the manufacturer and the aircraft is signed over to the customer. The delivery flight is typically operated solely by the customer's staff, however if it is the first aircraft of the specific type for the customer, the manufacturer may send training staff along for final training of the ground staff at the customers location if agreed so.