That is an interesting point on the lamp cord and I once asked an electrical inspector about that. Interestingly enough he was in the process of giving us a pile of mouth for running a flat screen tv cord inside a wall after hanging the tv
Lamp cord can handle 15 amps, but it can get quite warm before the breaker pops. The inspector said that it's okay so long as the lamp cord (tv cord or extension cord as the case may be), is kept exposed and open to the atmosphere. It can not be run under carpets, stapled to walls... or other such normal things that average homeowners tend to do with them.... and as I found out of course... you can't run them in walls either!
Yes, never run an extension cord, lamp cord, tv cord or similar under a carpet or through walls. They need to be in free air to prevent heat buildup, but they also don't have the proper insulation to withstand physical damage.
Have you ever noticed your home's outlets are no further apart than 12 feet? That's code.
That's because they don't want you to use an extension cord longer than 6 feet or plug two extension cords together to reach further. Those small household extension cords that resemble a lamp cord come no longer thsn 6 feet.
Insulation type is a whole other subject too.
The ampacity of a wire with THHN insulation can handle more amperage than a wire covered with plain old TW insulation. Wiring inside light fixtures have to have the proper insulation too, THWN. They have to be able to withstand the heat in a confined fixture housing.
So, it's not just the wire size, but the insulation type is also very important.