Power amp power draw questions

Some amps say they use up to 40A in 1 ohm. But an electrical circuit only is 20A. What does this mean?
Yes, but the 20A is at 120V. I don't think you're running 120V into your speakers!!
Yes, the current rating is output current - not input current (which is limited to 15A actually). The wall outlet limitation is power and is around 1800W.
There are a couple of sides to this. One answer is to look at power, not amps; the other is to see if this 40A rating is continuous or only for brief periods of time.

The amp has large capacitors which store energy so they can deliver large bursts of current for short periods of time. Some amps are better at this than others.

Considering power:

power = volts times current
watts = volts times amps

40A into 1 ohm requires 40 volts, that is 1600 watts (40 x 40)

Very few amps can deliver 1600 watts for very long. Some can do it for brief periods and that is really all that is required since these types of peaks in the music are usually very brief.

The law that cannot be violated is you cannot deliver more continous power to the speaker than you can draw from the outlet. Simply put, the amp cannot create energy, only transfer it to the speaker.

The maximum power from a 20 amp/ 120 Volt outlet is 2400 watts. The maximum theoretical effeciency of a class AB push-pull amp (all high power amps) is around 75% which leaves us with 1800 watts, but designing an amp that can handle the huge currents and the 600 watts of wasted heat AND sounds good is very, very difficult.

While it is true that 15A is the normal limit for an outlet in the USA, 20A is also very common in commercial settings and can be used in a residence with the proper wiring and outlets.
What it means, simply, is that the 40 amps is the secondary current out of the amplifier's transformer. The primary side of the amplifier's transformer is:

120 Volts input times 15 amps = 1800 (wall socket)...

The secondary side of the transformer must equal 1800. So if the secondary current is 40 amps, the secondary voltage is 45 Volts (1800 divided by 40 amps). The amplifiers' transformer is a step-down transformer, meaning it takes the 120v from the wall socket and "converts" it to 45 volts. Step-down transformers put out more current than they take in. The power company's transformer on the pole does the same thing - the utility generates less amperage than is used by the customers.

This is the simple solution - it assumes the transformer is ideal and that no other factors such as capacitors, etc., are considered.