You should consider such issues as surface charge and corrosion product characteristics, which influence inhibitor adsorption.
I should expect that the mild steel corroded more extensively than the stainless steel in uninhibited acid, in which case the more stable corrosion product could interfere with adsorption.
This can be interpreted; because the corrosion of mild steel is mostly in general (uniform) corrosion form but corrosion of st st is mostly localized. Moreover some inhibitors can decrease the general corrosion of mild steal but increases its SCC in sour environments.
Many commercial corrosion inhibitors were specifically designed for use on carbon steel. As such, their chemistry was selected for their ability to be attracted to a steel surface that is covered by corrosion products such as the iron oxides and sulfides. The surface of many stainless steel alloys is covered by types of chrome oxides and nickel oxides. Since these are not the surfaces that the inhibitor molecule was designed to be attracted to, the inhibitor may or may not be attracted to the surface. As Emeke Oguzie said, this is a matter of the surface charge of the metal and the design of the inhibitor. So, sometimes the inhibitor is effective on the stainless surface, but often it will not be because you are using the inhibitor for something that it was not designed to do, sort of like trying to use a hammer to tighten the nut on a bolt.
The inhibition efficiency is affected by many factors. However, heterocyclic organic compounds, containing N,O, S and P heteroatoms, generally active for the metal inhibition in acidic solutions via forming a physical barrier or blocking active zones of metal
The wt % of Fe in stainless steel is noticeably less than its content in carbon steel alloys, you should take this point in account when considering the adsorption characteristic of organic inhibitors on ( stainless steel or carbon steel surface). The vacant d orbital in Fe come to play an important role in facilitating adsorption of organic inhibitors, that in turn will enhance the corrosion inhibition efficiency of organic inhibitors. As mentioned above, "As Emeke Oguzie said, this is a matter of the surface charge of the metal and the design of the inhibitor" Prof Stephen N Smith cited.
The action of organic inhibitor is generally to be adsorption on the mild steel surface which is oxide free in HCl solution. The adsorb layer then act to retard the anodic reaction resulting in displacement of corrosion potential in the positive direction which is useful indication for the inhibition efficiency. Now in case of stainless steel which is passive film forming in HCl solution (although the passive film integrity increase with concentration of acid), the addition of organic inhibitor produce competitive impact on the blocking of reaction sites. Since, the passive film is superior in blocking the surface compared with any known organic inhibitors. The passive film in addition to retard the anodic reaction, block the diffusion path of inhibitor toward the film/surface interface, therefore in this case one cannot see any positive displacement in corrosion potential. This explains why organic corrosion inhibitors are more effective to inhibit corrosion of mild steel in HCl than stainless steel.