Yes, you can do a Ph.D. while working, but this can only happen if you are keen to work. Working full time and doing a Ph.D. is not easy; you won’t make progress without constant effort.