You can certainly do it. But with out your computer specs…no way we can tell you if it will run well. And if you have important apps that are compatible with 10.6.8…I can almost guarantee you they won't be compatabile with OS 10.10 "Yosemite" (4 OS versions newer).
Your iMac can sure run Yosemite, but respectfully suggest increasing the memory to 8GB which is what most recommend for Yosemite. Some older PowerPC applications will no longer run on anything later that Snow Leaopard OS X.6, including Office 2004 etc.
Backup everything first to an extarnal drive and download Yosemite from the App Store.