Yes.
Use something like Oak, Cherry or Apple. (Other hardwoods may work too so long as they're not toxic) Pine, Maple, Willow and Cedar are all bad choices. Cedar is hardwood but has nasty oils that will kill your fish, and any moths in the area.
Then yer gonna need to prep the wood. Cut off any rot, make sure it isn't infested with bugs or has any soft spots. Then scrape off all the bark. Wire brush, dremel or dremel with a wire brush attachment.

Then take the wood, toss it into a rubbermaid tote, and fill it with water and a great big handful of salt.
Put a lid on it and leave it sit for a week or so. The salt will kill of most any microbes or any other microscopic funk in it.
The wood water is more than likely brown by this point from the tannins. Dump it out and add fresh water. Check again the next day, keep changing the water until the water doesn't turn brown anymore and it stays down without the rocks.
Then time to completely sterilize. You're gonna need a big pot, and it will be stinky, but boiling the hunk of wood will make sure everything is dead on it. You can bake it too, (185-200 degrees I would guess,) but there is a chance of it catching fire. If you have access to a kiln I think that would lessen the fire hazard, but am not sure on that.
Then yay. You have homemade driftwood that you can use in your tank.