I am in the US now on a B1. I plan to travel to Canada for few days and have a flight back to India via NY.
Will there be any problem for me during my transit in the US?
It's unlikely. You'll probably clear US immigration and customs in Canada by way of the preclearance program, but whether you clear customs in Canada or New York, a B visa can be used for transit.
Of course, if there's something you're not telling us that would make you inadmissible, then you could have problems. For example, if you've stayed in the US more than 180 days longer than you were supposed to, you would have a three-year ban upon leaving for Canada.