Trees were a type of plant found on many planets and moons throughout the galaxy. Some sentient species such as the Wookiees of the planet Kashyyyk and the Ewoks of the Forest Moon of Endor made their homes in the branches of trees. The subterranean caverns of Aleen housed a species of tree-like sentients, the Kindalo.
During his life on Tatooine, trees were unimaginable to Luke Skywalker, who had never seen them in the landscape of the desert planet, however trees were found on Tatooine in the poles where the desert surface was much like a savannah. This explains how Tatooine has a breathable atmosphere, with oxygen..