Can I put an SLR lens on a DSLR camera?

I have an old SLR camera, with a 70-300mm Sigma macro lens. And a Nikon 5200 DSLR. Can I put the SLR lens on a DSLR camera?

In most cases, if the DSLR is the same brand as the SLR, yes.
(In other words, if your SLR isn't a Nikon, forget it.)
There are a few same-brand combinations that won't work.
The focal length will be different,
so don't rely on the indicated numbers on the focus scale.

If the SLR is a Nikon, then the lens will fit your D5200 - it won't allow autofocus or metering, but it will form an image.
If the SLR isn't a Nikon, you could buy an adapter, but it's not worth the hassle.

Yes as long as they have the same mount. If that Sigma lens you have has a Nikon mount then yes.

Yes. The lens will mount on your D5200. See link. I have the D5200 and several Pre-AI Nikkor lenses. The drawback of using them is that you have to use manual mode, otherwise you will get a "Lens not attached" message. From there set the aperture ring to the f-stop you want. Then play with the shutter speed and the ISO settings to get a good exposure. Everything, including focus, will have to be done manually. I don't know which type of lens your Sigma is, (Pre-AI, AI-S, AI-P?) so it may meter for you, but I have no experience with anything but Pre-AI and of course, modern AF-S lenses. Hope this helps.
http://www.bythom.com/lensacronyms.htm