Yes, with an auxiliary winding you can do it...its easy when the converter is in CCM, but when it goes into DCM, then you have to put in circuitry to ensure you dont get backflow of current through the secondary just after the secondary coil has discharged and before the primary has switched back on.
What you need for flyback to handle the DCM case is a signal to indicate when the primary FET has turned off…….then, following that, you want a delay of some 200ns, then you turn on your sync fet. Then you “look” at the aux coil and when it transitions and changes polarity, you then turn the sync fet off……..you then put the sync circuit at “rest” until the primary fet turn on comes again…….then you start waiting for the primary fet turn off signal again…..etc etc