PEX can't be exposed to the sun and I always hard stick it through the foundation and run the PEX inside.NO. Remove the iron pipe at the tee. Then screw a male PEX adapter to the tee and complete the run with PEX.
You CAN thread the iron pipe, but unless you had a threader, you would have to remove it anyway to take it to a shop to have it threaded.
You wouldn't like the summers though! 🤪I'm not a plumber, but I suggest a pvc sleeve where the pipe (copper, brass or new galvanized) could rub on the brick. I've replaced lots & lots of rigid & thin wall conduit that was dissolved by the alkalinity of the brick and/or the abrasiveness.
Paul
From Matt1963: Always amazes me when I see a water main above grade.
Me too says the guy who just came in to warm up after shoveling 9" of snow. I'm going to go live where Grubburg lives.