Tesla will give you a low trade in offer because they don't even look at the car before they give a quote. You must accept their quote on the web page to move forward, then you can talk about a CarMax quote match when delivery comes.
CarMax quoted me $2,500 more than Tesla for my 2016 228i BMW. I could get more privately but the time and hassle are not worth it to me, so I'm going to do the trade in and ask them to match CarMax.
Note: You can see the Tesla offer online without accepting it. Even if you drive it to the store they don't care to look at it, it's just a formula offer.
No, you don't wait until delivery for CarMax match. Do it BEFORE Delivery. You Just need to fax them (OA) your Carfax quote and they will adjust your online numbers.
Tesla's trade was fair and CarMax made it sweeter. Trading in a Tesla with "Software extra's" like FSD, power boost, etc. not so great.