Kinda, sorta - You can only use an i7 core Apple offers as a OEM upgrade or you'll have firmware problems. For example, an iMac "Core i7" 3.4 27-Inch Aluminum (Mid-2011) is technically a "configure-to-order" configuration of the iMac "Core i5" 3.1 27-Inch Aluminum (Mid-2011).
IMHO you won't save much, if any, money trying to do this configuration on your own. You don't have access to cheap CPU Apple does, you'll have to add in the cost of in your time, and if needed tools. Then ADDING the price of the i7 chip you decide to use. You're essentially buying an i5 chip that will net you a few dollars used (like driving a new car off the lot, it depreciates as soon as it hits the road).
Buy what you need to get the job done. Buy the best possible combination of MAXed RAM and CPU/HD your budget can stand. Upgrade it/replace it when it no longer works! The base CPU in 2 years will far outperform the top of the line of today, so save the money that one would pour into the upgrades in order to buy brand new down the line.
If you don't need a Ferrari, it would be much wiser to buy a new Camaro every two years than to buy a Spark and try to turn it into a Corvette and use it for 5. But, if you just want the experience to create a unique iMac, knock yourself out.
If this answer was helpful please remember to return and mark it Accepted.
I've already did this , I have a Mid 2011 27" 3.1 i5 ( intel 2400 ) I have upgraded it to i7 3.4 (intel 2600) it was same as doing so in 2010 models just some of the plugs are different you can follow the dual hard drive installation guid till you take out the mainboard then change the cpu and put them back