if you mean inside the case, after everything is stripped out, yes but with poor cooling options. If you mean as a swap for your processor, then probably not. Need more info.
So I would have to upgrade the motherboard then it would be compatible with the i5 processor?
As far as I know, those optiplex pcs use a propietary motherboard. Even the motherboard IO is situated in the right side from the PCI/PCI-E slots. I will assume that it is not upgradeable.