Every camera manufacturer uses a proprietary lens mount which means there is no compatibility between brands with one exception - Olympus and Panasonic. They pioneered the 4/3 format and lens mount and have now progressed to the Micro 4/3 lens mount.
Canon abandoned the FD mount which was used on their 35mm manual focus cameras when they introduced the EOS Rebel line of auto focus 35mm cameras that also introduced the EF mount. The EF mount is currently used on all their DSLR camera models. However, Canon now has two EF based lens mounts - the standard EF which is used on their professional lenses and the EF-S which is used on their less expensive lenses. An EF mount lens can be used on any Canon DSLR and on the older EOS Rebel auto focus 35mm film cameras. An EF-S mount lens can only be used on Canon cropped sensor DSLR cameras such as the T1i, T2i, T3i, T4i, T3, 60D, 60Da and 7D. The EF-S lenses CANNOT be used on Canon's full-frame DSLR cameras like the 6D, 5D and 1D nor can they be used on the older EOS auto focus 35mm film cameras.
Nikon introduced its F lens mount in 1959 and its still used today. With the exception of a couple of very rare older lenses every Nikon F mount lens made since 1959 can be used on any Nikon 35mm manual focus or auto focus camera as well as every Nikon DSLR made since they went to digital. However, in order to have a lower-priced lens line, Nikon offers lenses in two formats: DX for their cropped-sensor DSLRs like the D3100, D3200, D5100, D7000, D90 and D300S and FX for their full-frame DSLRs like the D600, D700, D800 and D1. A DX format lens can, however, be used on an FX body. The camera automatically crops the sensor to the size of a cropped sensor. Unfortunately, Nikon has also muddied the waters with their lenses by deleting the aperture ring on some lenses. A Nikon lens such as the 18-55mm f3.5-5.6G lens lacks an aperture ring and can only be used on cameras that allow you to control the aperture from the camera body. A Nikon lens such as the 17-35mm f2.8D has an aperture ring so it can be used on on any Nikon body. Nikon AF lenses will only auto focus on DSLR bodies with a focusing motor in the camera body such as the D7000, D90, D300S, D600, D700, D800 and D1. Nikon AF-S lenses have a focusing motor in the lens and must be used on the lower models if you want auto focus. A DX format lens with an aperture ring could be used on an older Nikon 35mm film camera but with severe vignetting.
Pentax introduced its K lens mount in 1975 and its still in use on their DSLR cameras today. Since Pentax currently doesn't offer a full-frame DSLR and all Pentax DSLRs have a focusing motor in the camera body their lens line is far less complicated. Lenses for a Pentax DSLR could be used on one of their older 35mm film cameras but again severe vignetting will result.
Sony DSLR cameras use the A lens mount which was introduced by Minolta with the world's first full-featured auto focus 35mm film camera - the Minolta Maxxum 7000 - in 1985. Since all Sony DSLR cameras have a focusing motor in the camera body any Minolta Maxxum AF lens ever made can be used on a Sony DSLR and will auto focus and meter as it should. Sony DT lenses are designed for their cropped-sensor DSLDs like the a37K, a57, a65 and a77. They are not recommended for use with the full-frame a99 or with older Minolta Maxxum AF 35mm film cameras.
Olympus abandoned their M lens mount when they went digital, first with the 4/3 lens mount and now with the Micro 4/3 lens mount.
Nikon, Pentax and Sony have the overall best backwards compatibility. Canon and Olympus have the poorest backwards compatibility.
Sony, Nikon, Pentax and Canon have all introduced mirror-less Compact System Cameras (CSC) which all use new lens mounts. These are best left for another discussion.
So whatever brand of DSLR you buy you're locked into lenses designed for that particular mount.