This question already has an answer here:
I have an esta. I am flying into USA, staying overnight before travelling to Canada by land arriving in Canada 12 hours later. I will be in Canada 100 days. Will I be able to return by land to USA to allow me to fly home?