Not a good idea
Heat is really one of the main causes of failures in electronic devices. Your receiver is putting out a lot of heat because it has to - it creates heat and has to then vent it - so trapping any heat and/or causing it to not be able to rid itself of excess heat is a disaster waiting to happen. The CD player is less susceptible, but still should not be exposed to heat.
They are designed for room temperature operation and not the excessive heat generated by another electronic device.
If possible have them on separate shelves and certainly give your receiver ample space on the top and sides and the rear. It should come with feet to elevate it a bit, again to foster good circulation