Stem bolts are safety critical, and seat clamp bolts to a lesser extent. If someone was swapping bottle cage bolts I wouldn't blink, but I'd be a bit careful of replacing safety critical bolts with stuff off
Ebay.
To do the job properly, you should know what grade of carbon steel you are removing (e.g. 8.8) and choose a stainless fastener grade that is at least as strong.
This link gives you an idea of the large variation in strength that can be encountered between different grades of fasteners. Top table is carbon steel grades, bottom table is stainless steel grades.
http://www.westfieldfasteners.co.uk/Ref_Strength_Spec.html