TikTok said it will take the Canadian government to court over an order forcing the tech company to shutter its Canadian offices due to national security concerns.