WinSCP offers unique feature to execute command on remote server as with regular terminal client. However as it does not implement the terminal fully, there are some limitations. Particularly, you cannot execute commands that require terminal emulation1) or user input.2)
Basically the feature is supported only for SCP protocol. With SFTP you can still use the feature by opening separate shell session, which in fact takes place automatically for you. With FTP you can only execute FTP protocol commands.
You can enter the command on Console window (Commands > Open Terminal).
If you are using Commander interface you can also enter the command on command-line box below the panels.
If you want to have full featured terminal, you may find command Open In PuTTY useful.
To automate remote command execution use scripting command call.
If there is command you need to execute regularly and in particular if the command works with files, you can find custom commands useful.