Yes, this in fact one of the best ways to sell turnips as it vastly improves your chances of finding a town with a high selling price. Reese will still tell you the turnip prices and allow you to sell them in the other town.
I don't believe the time of the other person's game really matters; I played with someone in a (significantly) different time zone to sell my turnips. When I arrived my turnips were perfectly fine.
The way turnips spoil is when you go back in time, which the game checks. The game can't really know who's time traveling if you join an online game. I'm unsure if going to a town that is several days different would affect anything, but my guess would be no. Going backwards in time and adjusting the clock at the main menu are the two ways the game seems to know you've fiddled with the clock.