Ok if you stay within Intel 6th gen cpu class, so yes for 6600k and 6700.  Unfortunately you cannot upgrade to 8th gen.  Motherboard chipset does not support 8th gen.  So no for 8350K. HDD upgrade depends on 3040 form factor.  Tower can accommodate two 3.5” hdd (one of them needs to be in external 3.5” bay), SFF only one 3.5” due to physical space restraints. gpu upgrade depends on your 3040 form factor which dictates stock psu power rating.  3040 tower psu is 240 w. 3040 sff psu is 180w.  You can upgrade sff psu or tower psu too with some limitations.[URL] 3040 sff can only fit low profile gpu. 3040 Micro does not support discrete gpu.
I am going to get a Dell Optiplex 3040 in a couple of weeks so does anyone know if I can upgrade the Intel core i3 6100 from the Dell OptiPlex 3040 to an Intel core i5 6600K, an Intel core i5 6700 or an Intel core i3 8350K? Can I also Upgrade the Hard Drive to 2 Samsung HD502HJ 500GB 3.5" 7200RPM SATA's or 1 Samsung HD103SI F3 1TB 3.5" 7200rpm SATA? Am I also able to put an AMD Radeon R7 240 2GB GPU into it and can I put these into the PC without needing to buy a better power supply?
Optiplex 3040 SFF, CPU, GPU, HDD upgrades