In college and the NBA, yes, when the ball is dead. In high school, check your state association's book for the dead-ball rule. No level lets you call one while the other team has the ball live.
Both NCAA books and the NBA grant a timeout to either team when the ball is dead: after a foul, a violation or the ball going out of bounds. So the defense can stop play then to change a coverage or set up a press.
During live play, only the team in control of the ball can get one at high school, college and NBA levels. FIBA never grants a live-ball timeout to anyone. It uses time-out opportunities instead, such as after a made basket for the team that was scored on.
Here is an example. The other team is breaking your press and you want to drop into a half-court zone. You cannot stop play while they dribble up the floor. Wait for the next dead ball, such as a foul or a ball out of bounds, then call it.
The common mistake is a player on defense signaling for a timeout during live play. Teach your bench and your players to wait for the whistle. And save defensive timeouts for real changes, because the same timeout could advance the ball for you late.
More In-Game Coaching questions
Free playbook
Get the free flex offense playbook
Every flex cut, starting set, counter, special and drill, with all 30 diagrams, in one printable PDF.