I have a bad 10 microfarad capacitor 400V but can not get a replacement.
Can I use 22 microfarads 400V instead?
It will depend on the application... A higher capacitance usually comes with a higher ESR (equivalent series resistance) and obvously induces a higher time constant when involved in resonant/ filtering circuit.
But by looking at the capacitance and voltage rating of your capacitor, I am assumming it is some kind of mains/power supply filtering capacitor. In this case, the +12uF difference should not cause any harm.
Be carefull to put the new one the right way around (I am pretty sure you are faced with an electrolytic capacitor, which has a polarity).
To summarize, it will most lokely work just fine.