Yes, it is allowed. For a TN Visa, NAFTA requires you to work for a U.S. employer. Your TD Visa gives you authorization to live in the U.S. You should speak with an accountant regarding your taxes, most likely you’ll need to file in both Canada and the U.S.