Yes you can. In fact I have this dual bootable hdd setup in my Dell, each hdd has a fresh installed Windows 10 and 7 respectively.  On startup it will ask you which OS to boot from. Caveat: Win 7 hdd transplant from old pc to optiplex would be all right as a secondary data drive, but might be a problematic primary boot drive: it might not boot properly (possible crash or BSOD) due to Win 7 innate poor adaptability to new hardware change.  But you can certainly boot fine from Win 10 on ssd in the presence of a secondary hdd containing Win 7.
I have a Dell optiplex 7010 pc with a win 10 pro OS on SSD. Can I install a second HD containing Win 7 pro OS  on HDD which is the main drive from my old PC ? 
adding a second HD