Can you develop a different accent by visiting another country for an extended period of time?
That depends entirely on how long you are there, and on you. Generally, the population of that country will see your accent as “fading,” but it would be more or less adapting their accent. It usually takes quite a long time to lose your accent naturally, unless you work at it for the sake of integration. I know someone who’s been in the United States for 30 years, but still has a heavy, thick Italian accent. I also know a Bulgarian friend whose accent is virtually non-existant, and he’s only been here for two years.