1. He went to a teacher training center to learn Python.

2. He went to a teachers training center to learn Python.

3. He went to a teacher's training center to learn Python.

4. He went to a teachers' training center to learn Python.
-------------------------------
Which ones are grammatical?

I wouldn't use any of those with possessives. Here's what I'd use:

He went to a teacher-training center to learn Python.