If it is over a week old a vet should have a look. I don't think you can do it without injury.
Read this and see if you can gently do what is recommended here. I would let the duckling be in some nice warm water since this will relax the muscles and may help.
Post back what you did and where you...
Is there any way you can get your duckling to a vet? I honestly don't think you can turn the foot to its normal position yourself. Did you check for slipped tendon?
Did you hatch this duckling and did it need help hatching explain why and the problems this could be a slipped tendon or a birth...
@FirstTimeDuckyMom can the duckling bend the leg out straight at all? If not it could very well be a slipped tendon.
go here and then down to post #3 @casportpony replied
https://www.backyardchickens.com/threads/slipped-tendon-in-chick-anyone-ever-try-to-fix-this-experiences.879233/