Next to, as in touching each other or the SSD resting on the HDD? Then no. They should be in their own bay/enclosure. The SSD will have it's own slot. And another for the HD. The SSD has no moving parts. The HD is a mechanical drive, with moving parts. It vibrates (ever so slightly), and it also generates heat. As long as they are apart from each other, they should be fine.
Physically? Yes, of course.
Make sure the HDD is secure in it's mounting... The SSD you have a lot more flexibility with though, as there's no moving parts.
Next to, as in touching each other or the SSD resting on the HDD? Then no. They should be in their own bay/enclosure. The SSD will have it's own slot. And another for the HD. The SSD has no moving parts. The HD is a mechanical drive, with moving parts. It vibrates (ever so slightly), and it also generates heat. As long as they are apart from each other, they should be fine.