One of the best policies is not to touch anything when diving. It protects the eco-system but it can also save your life.
During a group dive in the Philippines we came across a pair of Octopus twirling in the water together, as we approached they settled on a pile of rocks. One of the divers reached out with her finger towards one of them, I grabbed her wrist when it became apparent that her finger wasn’t going to point, but touch it, as the blue rings on the octopus started to show. If she touched it, it would probably have bitten her and she would be dead.
But your question was what you can touch. Rocks are usually safe, except if it is actually a stonefish. Sand… just realize that there is probably something like a stingray or bobbit worm hiding underneath…
Kelp is usually safe to touch. The small crabs and turban snails clinging to them are harmless and you really can’t harm kelp by pulling on it.
Marine mammals are protected, so when a harbor seal swims up for belly rubs do your best to resist.
Never pick up shells, never touch coral.
In the end, the best advice is to not touch anything when diving except your equipment. Even garbage needs to be looked over as a can might be housing a critter inside.