URP or HDRP isn't necessary to run Unity ECS. However, to render an entity, you require the Entity Graphics package, which doesn't function on the Built-in Render Pipeline.
In fact, an entity isn't solely about the visual aspect of your game; it can encompass various elements. If you intend to render an entity, URP is a necessity. Otherwise, if you wish to utilize other aspects of an entity, you can employ it within the Built-in Render Pipeline."
For better Details Check @DMGregory answer and also check @Philipp answer which is helpful to understand the context of entity.