Daenerys didn’t know. She was in love. She thought she was breaking the Targaryen incest cycle. Joke’s on her. Jon didn’t know either. He only found out from Sam and Bran while Dany was doing a victory lap on Drogon.
So, no—they didn’t knowingly commit incest. They just accidentally did. It’s the Game of Thrones version of a mix-up at a family reunion. “Oh, I thought we were distant cousins! Turns out we’re direct blood. Oops.”