It depends on the ingredient of the injection. Some medicinal substances irritate the superficial nerves more than others and hence are painful. For instance Vitamin K injection is quite painful while lignocaine, being a local anaesthetic is painless.