My ducks are opportunists. If they want to lay before I want to let them out of the coop, they lay in there. Otherwise, they will lay almost anywhere in the yard --sometimes right in the middle of the driveway. They've also laid under rose bushes, in the hay shed, even in their kiddie pool full of water.
I prefer to have them lay in the coop because it's much less work for me.
They will lay anywhere. But, you have to make them go into a coop if you want them cooped at night. It takes a few days, but they will learn the routine and be waiting for you to pen them up. It takes a bit of patience and consistency. I don't feel any run is safe, so mine get locked up at night.
Mine have learned the coop is safe and lay eggs in the coop.
I have a variety of breeds - everyone will happily lay in the coop except for my mallards who prefer to fly out of their pen and find a more natural hiding place to lay. It's like an easter egg hunt to find their eggs. I prefer to just collect them from the coop every morning