Domino’s Pizza has swung to a loss in the first half of the year, as the pizza maker announces plans to simplify the business.