Short answer: YES, shutting down some phone functionality is legally permitted. However, it is judicially reviewable.
The ability to throttle long-distance service in the event of emergency is a well-accepted capability, both in regulations and technically. This was implemented to be able to give government agencies and other first responders priority over the general public.
An interesting implementation note is that, generally, throttling occurs for outgoing calls from the area of the emergency, not for incoming calls to the area. At least in the days of plain old telephone service, throttled calls would receive a "fast busy" signal, so most people might not notice it.
These capabilities were developed more than 20 years ago on recommendation of the President’s National Security Telecommunications Advisory Committee. I'm not sure if there are FCC regulations related to it, but my guess would be that's where you would find any codification of the legal authority.
911 service is a different matter. During an emergency, telephone companies are not allowed to throttle service. The FCC has taken a number of steps to increase public safety by encouraging and coordinating development of a nationwide, seamless communications system for emergency services1. In fact, in 2018 Verizon announced that it would stop throttling emergency responders’ data speeds.
It seems implicit in the above that throttling data services to the general public is permitted, emergency or not.
Given the regulatory structure involved, there seems little that a telecom company could not be ordered to do by the president under the National Emergencies Act (NEA)
Note: Under the NEA, the United States has been permitted to do actions not normally permitted nearly continuously since 1976.
Continuous emergency powers, how's that for executive overreach?