There is a first sale doctrine in Trademark, but it might not (probably?) won't apply here. First, courts have found that not all reselling falls under first sale if the products aren't exactly the same. Here, by delivering they are serving different food because it gets cold and soggy. They could also argue that In N Out doesn't provide delivery service and this place is selling that service using In N Outs trademark.
The damage to In N Out is brand devaluation. People might think that In N Out sucks.
A clear example is: You can resell macbooks. You can buy them, sell them, even repair them.
But you can't set up a fake Apple Store that looks like a regular one.
Doordash is argue they are doing the former, and In N out will say the latter.