Once you have basic understanding of the topic, you can get better hardware: AirSpy (the same features as rtl-sdr, but MUCH better signal-to-noise ratio and bandwidth) or bladeRF (costly, but probably the best radio you can get now). For example I'm now building a weather radar based on bladeRF. The bladeRF has a FPGA with open-source HDL, so you can mess even with absolutely lowlevel and bleeding edge stuff.
Going back to your original question:
Most cards load firmware from a file when they are initializing (check "dmesg|grep firmware", on my machine, for example, it says it has loaded /lib/firmware/rtl_nic/rtl8153b-2.fw), you are free to modify it. However, all (or maybe almost all) wifi cards have the format of the blob completely undocumented so it would be very hard to make a modification that would allow you to transmit/receive arbitrary signals. Something similar has been achieved with GSM phones (see OsmocomBB), but it requires very complicated reverse-engineering.
Recently, there was a wifi stack released for a SDR, so the other way around: https://www.nuand.com/bladeRF-wiphy/.
In the US and other countries, it is to the best of my knowledge legal to modify firmware for hardware you own. The illegal part is broadcasting, most bandwidths are highly regulated. Listening on the other hand is mostly legal, or at the very least extremely likely to fly under the radar.
Few years back there was danger of FCC de facto banning alternative router firmwares like openwrt to prevent tampering with the wifi cards firmware.
This was the "only manufacturer signed firmware allowed" thing that thankfully was avoided.
FCC's motivation in this is to prevent people from using too much power or certain frequencies.
And as most manufacturers want to be able to sell in USA, it would have likely affected all versions. Kainda like how many wifi devices sold in Europe only go up to channel 11 on 2.4GHz, when the EU band goes up to channel 13. But ch12 and ch13 are not legal in usa, so they are blocked.
https://github.com/chunkeey/carl9170fw/ https://github.com/qca/open-ath9k-htc-firmware http://netweb.ing.unibs.it/~openfwwf/