So, if Caesar Clown and Blackbeard know how to extract the devil fruit from a person’s body won’t Dragon know about it as well? We can’t say for sure. But we can speculate as I believe that he might have known it. So, my point is that Dragon got Roger’s Devil Fruit on the day of his death and when the world government came to know about it they deemed him as the world’s most dangerous man.
But I don’t think that the government knew about it till Dragon used it against one of their officials like Akainu or CP0. That’s when the World Government realised that Dragon has the devil fruit ability that Roger possessed. However, there can be an alternate explanation for this. It is also possible that World Government acquired Roger’s fruit and gave it to Dragon. That is only if he would have been a Government official at that time. We don’t know anything about Dragon so it remains one of the possibilities. I think a lot of people believe that Dragon was once a Cipher Pol agent, if not, then a Marine. I don’t believe this, but again it is a possibility.