Emergency services were called to the Loganbarns area of the town as well as Euroroute Recovery, Garroch Roundabout, with cordons put in place from around 9.50 pm until the areas were safe.
No details of the substance have been released.
A spokesman for the Scottish Fire and Rescue Service confirmed the cordons were lifted at 1.50 am and those affected were discharged from hospital this morning.