Not yet. It's not as dangerous as first thought, but not entirely safe either.
When they first sent humans into space - they sent monkeys first because nobody knew if a human could survive for as much as an hour in zero g.
We now know that humans can survive for months in zero g - and if you do regular exercise every day - then some cosmonauts have lived in space for well over a year.
Nobody has yet managed to survive in space for two years and it's not known if that is possible. Only Russian cosmonauts have spent as much as a year in space and some of them were quite ill towards the end - though they recover reasonably quickly on return.
Some effects are longer lasting and for instance some bone loss will take more of order of a couple of years to recover. And may be some permanent effects.
Our bodies have not evolved to work without gravity - and many things go wrong in zero g. Main things
Blood pools in upper half of body, resting heart rate goes up, red blood cell count goes down
Can't lose heat through convection so body is too hot, so sweat more leading to magnesium deficiency
Bone loss in weight bearing parts of the body such as feet especially (not skull)
Kidneys don't work quite the same way, also digestion system and immune system, and also tend to get dehydrated and a bit malnourished
Because of all those changes, pregnant women particularly are not permitted in the ISS.
So - seems we need some gravity for normal lives, but nobody knows how much because nobody has ever done the experiments needed.
Might be we are okay in low gravity. Might be you only need an hour of gravity a day. Or might be that we need full g 24/7 to survive, nobody knows.
That's easiest to address in space rather than on the Moon or a planetary surface - you can create artificial gravity by spinning two habitats around their center of gravity.
But again - nobody knows what spin rates humans can tolerate in space conditions, though there are a few "informed guesses" - based on ground experiments - that may be wrong.
One way or another surely can do it - but might be anything from - just a spinning centrifuge inside a habitat - all the way up to needing tethers several kilometers long - depending on the spin rates humans can adapt to - and how much gravity you need, e.g. an hour or two a day - or 24/7 - and whether we need full gravity or low gravity.
Are simple experiments we could do - inexpensive by the standards of space missions - that nobody has ever done - that could resolve this question. We could have done those experiments back in the 1970s