Yes this computer should run Sims 3 and 4 without too many problems in medium settings.
However for Sims 3, please keep in mind there will still be some lag, stuttering and slow downs with Create a Sim, Create a Style and build mode. Also the more content you add like store content and custom content, the more the game will lag. This is due to the way the game handles additional content. Not much can be done to speed that up, unfortunately. But it is far less noticeable on a desktop.