When the pylon is placed properly it is both beyond the goal line and out of bound (oob).
How precise do you want to get with the pylon? It will matter to one team or the other.
This is kind of like a block in the back. Where is first contact.
For a loose ball to strike what I will call the up field side of the pylon (the side furthest from the nearest endline) first, the ball would have had to crossed oob before reaching the goal. Thus no touchback or safety but oob between the goal and the 1 yd line.
Likewise, if a loose ball touches the inside of the pylon (nearest other sideline) first, it would have to break the plane of the goal before being oob.