If an invention is in use in a foreign country, but it is not patented in that country (or any other countries), and it is not the subject of a printed publication anywhere, could that invention be patented in the U.S.A.?
It's a tricky question. In past there were cases when a patent was awarded despite the fact that the invention was demonstrated or even standardized in other countries.
One notable example is MagSafe patent (US-7311526) that Apple filed in 2005 and was awarded in 2007. However, not only were magnetic power cords used before that but they were even standardized in one case. In 2001 Underwriters Laboratories designed a standard for safe operation of deep fryers in Japan that required kitchen appliance manufacturers to use magnetic power cords in their consumer products.
However, despite the fact that these power cords existed and were known in the industry the patent was awarded to Apple and surprisingly no other consumer electronics manufacturer questioned their claims.
It seems like the Underwriters Laboratories doesn't have that standard published on their website but this work is mentioned in the bio of one of its founders - James Beyreis
In a direct answer to the question, absolutely yes (the title is worded opposite to the question so the answer to the tile is no), up until March 16th when the provisions of the AIA kick in. The old/current law says you can't get a patent if it was patented or published anywhere in the world. Or if it was known or used by others in this country - 35 USC sec 102(a). That all changes with the AIA so that the location of the known or used is worldwide. I think it was originally USA specific due to the difficulty of proving or disproving that something was known or used out of the country. A publication is in black and white.
That does not mean one can steal an idea you learn on a foreign trip or apply for a patent when you know you are not the first and true inventor, inventors sign an oath to that effect.