Exactly this. The fact that dominoes makes money off the pizza sale just means they have a business stream to subsidize the cost of delivery to nearby locations.
Same reason Amazon can run Fresh. If you order groceries and your neighbor orders an Amazon package, just pocket the money that would've been paid to a carrier to deliver that box and get your Fresh driver to do so instead.