2012 iMac RAM Upgrade
Yes, you can and it's quite common practice.

https://support.apple.com/en-us/HT201191

One concern might be how the memory channels are laid out, as it's generally better to have symmetrical RAM configurations to balance dual-channel access. (so you'd want each channel to be 4+8)