can it "charge"? yes. The charging circuitry either can query the output voltage of the power supply, or knows what the voltage should be (on insertion, 5VDC) and determines if the wire is too small or too long to support higher wattage. There's a reason that quickcharge et al use 9, 12, 18 volts, same wattage, but compatible with any of old, too long, or too small gauge wires.
You'll notice weirdness with anything that speaks a different language, i think USB defaults to power delivery, which is 5V @ 2.5A - or whatever. If your charger speaks the same protocol as your device, it will get as much power as it can through whatever cable you use.
this doesn't speak to other comments about "high speed USB C" - i have plenty of power delivery cables that do decent wattage but cannot transfer data, it doesn't even beep the computer when you plug something in to it.