I wonder how to know which preposition to use. In this case whether to use en or dans.
No, you can't, as another member commented, this would mean "I'm speaking inside English".
What you can say:
"je parle en anglais": a typical situation where you say this would be that you are actually speaking English with someone, and somebody else asks you what language you are speaking. So it's more of a description of a continuous action that is taking place.
"je parle anglais": this would be used more as a general statement, eg. "What languages do you speak?" "Je parle anglais, français, espagnol"; or if you want to tell someone you know English.
That is the theory, in practice you can use "je parle anglais" to describe the current action that I was talking about in the first point. ("Oh, tu parles quelle langue là ?" "Je parle anglais")
This is not true the other way around: if you answer "je parle en anglais" when someone asks you what languages do you speak, they will understand but identify you immediately as someone who doesn't speak proper French.