Is it ok to withdraw from a PhD when receiving another job offer?
In the US, you can withdraw at any time, even after starting. If you  have signed a contract for some services, then you may have to deal with that, but most universities will let it go since those services can almost always be handled by other people.
People leave doctoral education for lots of reasons.
But I suggest you think long term about your career and whether a job is preferable to a doctorate.