Yes, potentially, but I’d treat delivery and store pickup differently.
Apple’s German Online Store says a VAT refund may be available for a Mac delivered to a German address. It must be a private purchase, carried out in your personal luggage, and exported by the end of the third month after the purchase month. You’ll also need proof that you permanently live outside the EU and customs confirmation of the export.
Apple doesn’t say that a tax-free form is included automatically. Before ordering, I’d call the German Apple Online Store at 0800 2000 136 and confirm which document they require and where the customs-stamped paperwork must be sent.
I wouldn’t assume store pickup follows the same process. Apple’s published VAT wording specifically mentions delivery to a German address, and pickup purchases are contracted through Apple Retail Germany instead of the online-store entity. Get confirmation from the pickup store before paying.
When leaving the EU, take the MacBook, invoice, passport or proof of non-EU residence, and the required export form to customs before checking your baggage. Customs certifies the export; the seller handles the refund, and the refund isn’t automatic.
A friendly note: This is the German-language Apple Support Community. Posting your question in German will make it easier for more members to understand it and offer assistance.