In the course of a the game, the players will want to avoid forming configurations o-o or oo, because that means the other player will win in the next move. Thus they will have to open doors in order to split consecutive sequences of closed doors into two smaller consecutive sequences of closed doors.
If a player creates a sequence of length $0$ or $1$ bounded by opened doors (o-o or oo) by opening a door, then the next player wins, so until the last move, the game will only consist of sequences of length $\ge 2$ (except maybe at the boundaries)
Add three imaginary doors on each side of the original sequence, and open the two extreme doors.
Then you have an equivalent game, since the players will never try to open the $4$ closed imaginary doors (this would create a sequence of length $<2$ allowing the next player to win). Therefore we only need to think about games with sequences of closed doors bounded by two open doors.
Since players play into only one sequence at a time, we can consider that each sequence is its own game, and we only need to compute their respective Grundy numbers.
Letting $\otimes$ be the bitwise xor operations on natural numbers on $\oplus$ be the superposition of games, we have $G(x \oplus y) = G(x) \otimes G(y)$, and $G(x) = \min \Bbb N - \{G(y); x \to y\}$ (where $x \to y$ means there is a move to play on $x$ to get $y$)
If we note $n$ the game with a sequence of $n$ closed doors bounded by two open doors, and looking at the allowed moves, we get :
$G(n) = \min \Bbb N - \{G(i)\otimes G(j); 2 \le i,j ; i+j+1=n\}$
This allows you to compute the Grundy number of $(n)$ in $O(n^2)$ steps.
For example, $G(2) = G(3) = G(4) = 0$ because you can't make any move in there (you can't play in there without creating a $(0)$ or $(1)$ sequence, which means the opponent wins globally on the next turn).
If $G(N+4) = 0$ then the first player loses, and if $G(N+4)>0$, then there is a winning strategy for the first player.
The first few $N$ where the first player loses are $6,12,22,30,32,44,54,64,76,86,98,\ldots$