You could use other things such as brick, block or stone if you wanted too. However pressure treated lumber can be used, just keep any plantings at least a foot away from the wood, 2 feet if possible. PT wood contains arsenic that might leech into the soil and be sucked up into the plants, though that leeching drops off dramatically within a handful of inches from the wood. The arsenic doesn't "migrate" too far, but you don't want plant roots to grow out close to the wood either.
You could use other things such as brick, block or stone if you wanted too. However pressure treated lumber can be used, just keep any plantings at least a foot away from the wood, 2 feet if possible. PT wood contains arsenic that might leech into the soil and be sucked up into the plants, though that leeching drops off dramatically within a handful of inches from the wood. The arsenic doesn't "migrate" too far, but you don't want plant roots to grow out close to the wood either.