I played a game in which I had a queen against a rook but it seemed that my opponent’s king could protect his rook, and there were no pawns on the board. In the end, I drew the game. Are such games be drawn easily and won only in certain positions?
A queen wins against a lone rook, unless there is an immediate draw by stalemate or due to perpetual check, ... (or if the rook or king can immediately capture the queen)
The same article also says
With perfect play, in the worst winning position, the queen can win the rook or checkmate within 31 moves
In practice if the defending side knows what they are doing it can be quite difficult to win, especially if, as you say, the king and rook remain in contact. A key position to know is the Philidor position, where white can force the king and rook to be separated, and then the rook can be won by a fork. See https://en.wikipedia.org/wiki/Philidor_position#Queen_versus_rook