You can, but it would be space that would be wasted. I'm growing toms, cucumbers & peppers in my poly tunnel. The courgettes & beans will grow perfectly well outside. If you'd have asked the question in April I would have said yes, you'd be picking them now.
They would probably do very well in the greenhouse, but they are both extrememly thirsty plants and in that environment, they will need watering morning and night.
Outside they will benefit from the rain and natural ground water. The courgettes will also prefer the extra room out in the garden unless you plan on having nothing else in the greenhouse so they can grow far and wide!
Thanks for all the answers, I always grow french beans and courgettes outside, but have recently got a big greenhouse so I have lots of room. I really wanted to know if anyone had actually tried growing them in the greenhouse. I have one courgette outside at the moment (in the rain), but it is looking a bit sorry for itself! I'll give it a try and report back.