Not sure how possible this would be in the 17th and 18th centuries, given that Japan had the advantage in terms of manpower compared to what European powers could realistically send there [EDIT: Not sure how aware western powers were of this, even the Dutch. The English concession in Hirado used to send a delegation to Edo once a year until it was closed, so maybe there could have been some knowledge of this, but how much this knowledge would have survived into the following decades and centuries is unclear]. Also don't forget, Japan had more guns at the time than were available in the whole of Europe.
It could however be possible in the mid-19th Century. If the Shogunate had not negotiated with Commodore Perry and opened up some treaty ports and begun to adopt western technology, it could have been possible that 1. Edo would have been flattened by the black ships and 2. the Americans would have come back in greater numbers to force Japan to open up, and with up-to-date 19th Century tech, would have made short work of the samurai. Not sure if America would have colonised it, but it could have set Japan up as a protectorate in much the same way as the Philippines were set up a few decades later. It didn't have to, but it would have made strategic sense as a place to project American forces in Asia (before the Philippines) and to act as some kind of counter to the European concessions in China.