Two ways.

From command mode:

:r!command

Or from insert mode, press Ctrl-R, then enter

=trim(system('command')