Flue Pipe

Is it okay for a double walled flue pipe to be in contact with a wood frame?

No…

It has to have 1" clearance to prevent pyrolysis.

Agreed it needs 1 inch. Side question. What if it is a double wall B vent pipe but it is PVC attached to a tankless water heater. Still 1 inch? Tankless water heaters around here require stainless or PVC TYPE B Vent due to the corrosive nature of the flue gases

What is a PVC b vent? Are you talking about a concentric vent?

Yes kind of. It is a concentric vent like you would see on a furnace but slightly different in that the concentric pipe runs all the way down to the connection on the water heater and the design is a little different but it is the same concept with exhaust gas through the inner pipe and the combustion gas through the outer pipe. B Vent was the wrong wording to use there

Same question though. Can that touch wood framing?

Yes, those vents do not reach temps which can harm the wood.