If you hold both a valid Canadian study permit and a valid US travel visa, and want to fly into New York for a stay before continuing on to Canada:
- This is generally allowed if you have valid visas for both countries.
- Be prepared for closer questioning at the US port of entry about your purpose of stay, especially since you won't have a return ticket out of the US (you'll be departing onward to Canada instead). Having a clear, honest explanation (e.g. visiting family) and documentation to support it helps.
- Having immediate family in the US to visit is a reasonable and commonly accepted purpose that can make this line of questioning easier to navigate.
The main friction point isn't the transit itself but justifying an open-ended US stay without a same-country return ticket — go in prepared to explain your travel plan clearly.