In general stud welding requires a clean surface.
More specific the surface must be free of paint, rust, grease, oxidization (especially for aluminium), oil or other coatings that are not suitable for welding. In some cases a weld can be achieved even with a painted surface. That depends on the paint’s thickness and specifications. Also galvanized surfaces must be checked for weldability.