Gandalf didn't get resurrected in a forest
He was resurrected on the mountain-top where he had fought the Balrog:
Naked I was sent back – for a brief time, until my task is done. And naked I lay upon the mountain-top. The tower behind was crumbled into dust, the window gone; the ruined stair was choked with burned and broken stone. I was alone, forgotten, without escape upon the hard horn of the world.There I lay staring upward, while the stars wheeled over, and each day was as long as a life-age of the earth. Faint to my ears came the gathered rumourof all lands: the springing and the dying, the song and the weeping, and the slow everlasting groan of overburdened stone. And so at the last Gwaihir the Windlord found me again, and he took me up and bore me away. (TT, the White Rider)
From there he was taken to Lórien where he was healed and clothed in white, and from there he just met Aragorn, Legolas and Gimli in Fangorn Forest.
Sauron didn't get resurrected in a forest
Sauron wasn't actually "killed" in the same manner as Gandalf was, his spirit didn't leave the world, so there was nothing to be "resurrected":
But Sauron also was thrown down, and with the hilt-shard of Narsil Isildur cut the Ruling Ring from the hand of Sauron and took it for his own. Then Sauron was for that time vanquished, and he forsook his body, and his spirit fled far away and hid in waste places;
and he took no visible shape again for many long years. (Silm., Of the Rings of Power)
Sauron merely started taking visible (and physical) shape again at Dol Guldur, but otherwise he had never been "killed" and his spirit was still in Arda even after he had lost the Ring.
Sauron's occupancy of Dol Guldur in Southern Mirkwood has a clear out-of-universe explanation: when Tolkien was writing the Hobbit he was using elements from the Silmarillion mythology. In those stories, after Beren and Luthien originally defeated Sauron he fled to the ancient forest of Taur-nu-Fuin (formerly Dorthonion) and "filled it with horror". Taur-nu-Fuin is, of course, Sindarin for "Mirkwood", so this was just a case of Tolkien reusing parts of an older story.
In-universe I'm not aware of any significant reason why Sauron chose Dol Guldur, but I'm also not aware of any reason why there should have to be one.