Does a door have to be hung on the edge of the jamb
You can do so.  It will complicate the strike plate mounting, perhaps necessitating a relief arc in the latch jamb. The centered door will only open (at most) 90 degrees before being stopped by the jamb.

Other options may be to reverse hinge side and latch or making the door out swinging.