Can templates store data or modify host params?

Q: Is there any way a template can store data or change anything in a fact or foreman host param that could be used later?

Normally, no - templates are rendered in a safe mode that prevents rendering from modifying the internal system state.
There are two options you could go with this:

  1. Create a custom fact that will update the host once puppet is run on it with whatever value you need, which can then be also used for host params.
  2. not recommended - disable safe mode rendering in the settings page. This will allow you to do anything you want in the templates, including modifying host details, but is very dangerous as any user able to edit templates can gain access to the foreman server this way.

If you explain a bit more about your use case, perhaps there is something else that we could recommend.