Please quantify "small office".
Look at the minimal hardware requirements for Windows Server 2012 and compare to the Dell OptiPlex's hardware.
Check the requirements one by one.
If the Dell meets the minimal requirements you plan may be viable but the performance may still not be what you/your office requires.
On the other hand if all you need to do is add memory - then that may boost performance to a workable level.
Then again if you already have the server software and the Dell, then give it try.
No harm per se and you will probably learn more about it all and be able to work out what you truly need for the end system and setup.