You can do both
You will be subjected to the standard 5% royalty after 1M$ as normal. You’re just not allowed to use Unreal Engine’s source code or the free assets it provides in other engines.
Make sure to read the Unreal Engine EULA before releasing your project.
You can also consider checking out the FAQ and the licensing options that might come in handy if your project generates enough money
Hope this helps!