Sure they can be trained, but my experience with guineas is that they wouldn't like most chicken coops and wouldn't want to stay in them any more than they have to. They like LOTS of space, space enough to fly a bit, in fact, and to roost up much higher than what the average chicken would find satisfactory, for starters. I kept mine in a baby barn with a single long roost that spanned the width of the building set about 9 feet up, plus they had a chicken ladder so any youngsters that couldn't fly too well yet could get up with the adults, which helped them develop the good habit of roosting indoors every night. For nesting, they liked a well bedded area directly on the ground under an overhang of some sort...two-foot-wide shelving set about four feet high created artificial cover that made them happy, plus of course they liked running around on the shelving. I'd prop a large piece of plywood against the wall under the overhang, creating a cozy, partially hidden nook for them, and voila, a communal guinea nesting site. Once one hen used the nest, others did too, and most of them could be trusted to come inside the barn to lay after that if you left a few eggs in the communal nest. Keeping them shut inside until noon also pretty much guaranteed they'd lay indoors, of course, but unless their accommodations are truly to their liking, I think they get a little resentful about being shut in and start becoming leery about going indoors even to roost at night. They are pickier birds than chickens, that's for sure!
Basically, you try and recreate what it is they like about nesting outdoors, and if they find it acceptable, they'll generally become agreeable about laying where you want them to. If they don't like what you've got to offer, you'll have to keep them shut in until noon or so to get eggs, and even then, some of them will hold off laying until they get outside.