I would never pick up wood that I found just lying around in the forest. It's usually soft and rotten, rarely ever gets a chance to dry out completely if it's just sitting on the ground. If it comes from a tree species that contains toxins, there's a good chance that some are still in it.
On the other hand, driftwood...actual driftwood, brought in by tidal or wave action...found on the beach is usually pretty safe. I'm referring to aged, well-worn wood that has been soaked and then dried out on the beach, likely more than once. All the bark and soft stuff is long gone, nothing to rot or stink. Trace elements of toxins are likely long leached out. Wood like that usually takes a long time to waterlog and sink.
I've heard folks worry about the salt content of wood found on marine coastlines, but it's never been a concern for me. When you consider the tiny volume of even large pieces of wood compared to the volume of your tank...and then realize that only a small percentage of the wood's volume consisted of absorbed water...and then look at the salt content of that little bit of water diluted in the total volume of an aquarium...it isn't worth worrying about. Normal water changes will quickly dilute and remove even that little bit.