If you're taking the identical picture under the same lighting, then any combination of shutter speed and aperture that gives the same total exposure should give the same results (reducing the light coming in by going to a smaller aperture (bigger f number) can be compensated for by keeping the shutter open longer).
With film, that starts to break down at long exposure times (multiple seconds)
due to reciprocity failure, but digital sensors aren't affected by that.
Things that might cause problems:
If you're running in manual mode and setting exposure time and aperture yourself, the lighting may have changed between shots (clouds across the sun or whatever).
If you're running in aperture or shutter priority auto exposure mode, then if the framing of the shot is different, that may give a different exposure metering result (especially for spot metering, still possible for other modes).
If you're new to photography and have been using exposure compensation to change aperture/exposure time in auto exposure mode, or have exposure bracketing turned on, both of those are supposed to change the total exposure and thus brightness of the result.
Otherwise, it may be a lens or shutter fault. The lens aperture stays wide open while focusing with a DSLR, then closes to the set value just before taking the picture, then reopens. It's possible that there's a problem with that stop down mechanism - for example, the aperture blades may be a bit sticky and taking longer to close than they should, so the picture may be being taken while they're still closing, giving a brighter result. Shutter problems are also possible, though probably less common.