Please search the Community as there are (at least) tens of discussions and examples.
Bottom line: you can use the Marketo Forms JS API (NOT the REST API) to link a custom form to a Marketo Filled Out Form activity. This will work very well if you have the dev skills to set it up. Any other method (server-side approaches) represents a DoS vulnerability.
You can use Wordpress forms or Gravity forms. There are some companies like LeadMD, Hoosh, Grazitti, that provide plugins for connecting Wordpress form with Marketo. However, they are not fully secure. There are many old threads on the community regarding these.