If the generator is covered by a plastic or metal shell, that is fine so long as enough airflow is being provided – and as long as you are not inside that space.
You do not want a generator running inside of a tent for example, because the exhaust won’t be getting vented properly.