Yes, it is possible - however I would recommend not doing it.
Exposing command-line and administrative functions via web parts has the potential to expose security issues for your SharePoint farm, and allow users to potentially do tasks which they should not be able to do.
To remotely execute commands, you can use PowerShell and connect to a remote computer to do so (this Technet article explains PowerShell executing remote commands : http://technet.microsoft.com/en-us/magazine/ff700227.aspx ).
If you need to execute tasks in the absence of a user, you can use scheduled tasks using Windows Task Scheduler.
Of course if you do need to, you can create a web part, and either use C# code in an event handler (e.g. a feature receiver, event handler) and either execute a command or use the SharePoint API to complete a task. Depending on what you are trying to achieve.