yes you can but... It wont trim marlin down in the build size at all. Marlin already auto removes all unneeded code.
Also If you do that and need help the first thing they will do is see what you have changed. If you have removed all the xtra unused Config settings it make it nearly impossible to see what setting you have really set.