Don't use a 15-amp extension cord on a 20-amp breaker.
No. Even if your current load is under 15 amps, the breaker is designed to allow up to 20 amps before tripping. If something changes — a surge, a short, or you plug in something else — that cord could carry more than 15 amps and overheat before the breaker ever trips.
The breaker protects the wire in the wall, not the extension cord. A 15-amp cord on a 20-amp circuit means the cord becomes the weak link. If it fails, you get a fire, not a tripped breaker.
I would not do this. The few extra feet aren’t worth it. Get a 20-amp rated cord or use a different outlet.