I have actually researched this in depth. The issue at the time was Greenland, not Canada, but the general principle still applies. Denmark is a NATO country. Article 1 clearly states that all disputes between members are to be resolved peacefully through negotiations. Here is an article discusses it in more depth.
Here is a rigorous legal clarification on the issue, that I am sure the general concept is familiar to all senior officers in the American armed forces.
And here is a legal brief on the principle that a peace treaty is the Law of the Land.
https://law.justia.com/constitution/us/article-2/16-treaties-as-law-of-the-land.html
I sincerely doubt that an officer that has achieved his rank, position. and status would not be aware of all of these considerations when he claimed that the scenario was 'preposterous'. I am sure these issues, given Trump's emotional statements, have been thoroughly explored by officers in his, and more senior, positions. Their response to such an order would not be a knee jerk off the cuff on the spot response, but a response that has been well planned out and thoroughly vetted ahead of time.