I'm looking for a way to close gaps between soil and shed deck. Can I use pressure treated wood, or it should be metal (since it touches soil)?
The goal is to restrict that area from animals, snakes etc.
Ground contact rated pressure treated is an option. Pressure treated that is NOT ground contact rated is useless in contact with the ground (it will rot, a bit slower than untreated lumber.) Keep the little tags from the end of the lumber and your receipt somewhere you can find them again if it fails during its rated life. Without ventilation, it may trap excessive moisture under the shed.
Metal is an option. If animals out and ventilation in is desired, galvanized or stainless steel mesh. If you really want to keep animals out, with any approach, you can't just stop at ground level (they dig.) Classical "best method" is to go down a ways and out a ways (so if they dig down next to the outside of the above-ground mesh, they hit more mesh, rather than finding the bottom of the mesh and going in.)