In principle, it is possible. A tilt-shift camera can bring any plane in focus, so running it in reverse will project the image sharply on your ceiling.
See https://en.wikipedia.org/wiki/Tilt–shift_photography for cameras. https://www.projectorcentral.com/Understanding-Lens-Offset-a... learnt me that you can buy projectors that use this method. I suspect that back-projecting televisions (https://en.wikipedia.org/wiki/Rear-projection_television) often use it, too.