Yes, it is fully legal because it is open source software and you are free to do whatever change you want.
You can use css hide option but it does not work properly and sometime it can break website design.
You can replace or add your own codes, if you want so then just modify affiliate website URL with your website URL.
Some premium themes provide disable option and for it, you need to visit customizer option.
Mostly developers protect it with encrypted security, so online decoder help in it.
Below are some codes which are in zip format and you need to find those codes in editor and remove or delete them and save the file, that’s it.
Just choose below themes to get further steps, so you can remove bottom bar area credit: –