The Nikon D3000 accepts both DX and FX lenses. However, it doesn’t have an AF motor built-in so you need to make sure the lens you’re thinking of buying has DX in its name. It’s quite hard to find a lens without a motor in this age, but it doesn’t hurt to know.
Since the D300 is a DX camera (aka: Crop Sensor Camera) it can accept both DX and FX lenses (FX stands for full frame) so you don’t ever have to worry about a lens not fitting (physically).
There are however differing levels of compatibility. You can consult to Nikon’s Official Compatibility chart the to see what will work with all the different types of Nikon lens.
If you’re not familiar with Nikon’s F mount, that’s the reference to the physical attachment of the lens to the camera body. In addition to that, to determine the compatibility of a lens with your Nikon you would then look to see if it’s a DX lens or an FX lens, which refers to the size of the sensor in the camera.
The F mount is universal between both sensor types, meaning the lens can physically attach. Although DX lenses aren’t something we would normally recommend on a FX (full frame) camera. One reason is because of vignetting around the edge of the image.
Determining the lens type is a bit more challenging since lens names are a bit of an ‘alphabet soup.’ But once you understand the basics of lens terminology you’ll start feeling like a pro.