Yes, they can turn male during flowering if stressed too much during the flowering phase. This is what we call a hermie (hermaphrodite) meaning containing both male (pollen) and female parts (pistils/flowers). Best way to avoid it is don't stress the plant and if inside no light exposure during the dark period in flowering.
Originally Posted by kdub82
Yes, the wind from outside can easily pollinate your whole crop making it seedy. If you want seedless bud remove the male immediately after confirming that it is indeed a male.
"Make the most of the Indian Hemp Seed and sow it every where."
- George Washington
"A dope fiend refers to the reefer butt as a roach, because, it resembles a cockroach." L. Ron Bumquist: Fear and Loathing in Las Vegas