Pugh's left-footed strike in the 19th minute in Switzerland left Tony Pulis' men needing only a draw in the return leg at the Britannia Stadium next week to move through to the next stage.
Thun goalkeeper David Da Costa was sent off in the final minute for violent conduct and in injury time his replacement, midfielder Stephan Andrist, tipped a Jonathan Walters strike round the post.
Currently top of the Swiss Super League table, Thun had had the first shot through Andrist in the 13th minute which sailed over the bar, while Robert Huth booted clear a Muhamed Demiri cross.
Pugh's opener did not make it easy for the visitors as Thun piled on the pressure and after clearances by Huth and Ryan Shawcross, Stoke keeper Thomas Sorensen tipped a Thomas Reinmann free-kick round his post.
The home side continued to press for an equaliser after the break with Reinmann hitting a right-footed shot over the bar before Shawcross got in the way of an effort by Roland Battig.
As the game wore on Stoke's fitness began to tell with Matthew Etherington shooting over the bar then bringing a fine save out of Da Coats, who punched clear.
Benjamin Luthi drilled a right-footed free-kick into the Stoke wall in the 84th minute then Stipe Matic fired wide from 12 yards from a Reinmann cross.
As Stoke held on, Da Costa let his frustrations get the better of him and shortly afterwards the final whistle left the Premier League side in command heading into the second leg.