are you familiar with the Mx Model Reflection https://marketplace.mendix.com/link/component/69 module? you could use this module to retrieve an entity by the module and entity name
There is no builtin functionality within microflows that allows you to retrieve an entity by passing its name as a string.
You can write a general java action to retrieve some entity, but you still need to know at design time, which type you expect, since Mendix cannot handle generalized entity types in a microflow.
If you know the list of possible entities upfront you could model a path for each possible type.
I am not sure if this works for the logic you need to execute but I would consider using the ExecuteOQLStatement Java action from the OQL Module, in which you can build a query to retrieve the information. It will not directly retrieve the objects but it will create objects in a resulting entity.
Select * From Module2.Entity2
The ExecuteOQLStatement action executes a given OQL statement. For each column, the action expects an attribute in a result entity with the same name. If the result is the ID of an object, it expects an association with the same name (without the module prefix).
Could you elaborate on your use case? How do you know which attributes to work with?