Can a 777X legally be ferried with one or both wingtips folded?
As Ron notes in the comments to another answer this is a perfect situation for a Ferry Permit/Special Flight Permit. The FAA via your local FSDO can authorize aircraft to fly for the purpose of being fixed elsewhere via a ferry permit. This question covers whats needed for that.

However in some cases it may be cheaper to fly (or drive) in a maintenance team and fix it on site. Moving an empty 777 even short distances means burning quite a bit of Jet-A. For the cost of the reposition it may just be cheaper to send a team (possibly in car) with the parts and tools they need to get the job done. 

On a similar note its likely that the majority of fields big enough for a 777 to touch down have at least some form of maintenance on hand. Again it may be cheaper for an airline to contract the job to a local shop than bother with the ferry logistics and costs.  

Boeing also offers these services if you should need them in a pinch as part of the AOG services. 


  Our technical experts will provide on-site, comprehensive and
  integrated assistance to recover an airplane. Our goal is to quickly
  and safely return airplanes to service, using methods and procedures
  that avoid costly secondary damage.


From what I can tell they will basically show up with parts and people to get the plane back in the air just about anywhere you can fly it out of.