Yes, as long as the networking in your VPC is set up so the Prefect server is visible to the Sagemaker job. As long as the EC2 server's IP address is accessible from the Sagemaker job, you shouldn't need to do anything aside from setting PREFECT_API_URL.
I can't speak to the specifics of how to set that up because I'm much more familiar with Azure than AWS, but I imagine that a Sagemaker job needing to communicate with an EC2 VM is a fairly common use case.