Can I replace a 30 amp breaker with a 40 amp breaker?
Then, can I replace a 20 amp breaker with a 40 amp breaker?
Different question and the answer is "It depends". But in general the answer is "No, do not go and put a 30 amp breaker in place of a 20 amp breaker because the wiring is most likely 'sized' for the 20 amp load and -may- overheat if a 30 amp load is used with wiring sized for a 20 amp load."
Consequently, can I replace a 30 amp breaker with a 50 amp breaker?
30 amp circuits use a 10 gauge wire, while 50 amp circuits require larger 8 gauge wire. Consult with your local building department or a licensed electrical contractor before making the change. Better to be safe than sorry, a overload on a circuit that powerful can cause a major fire.
No! The only safe way to increase the circuit's capacity is by replacing the wire with one of adequate gauge. For 20 amps, 12 AWG copper is adequate for up to about 100 feet. If you simply replace the breaker, the wire can overheat and ignite the building from inside the walls.