Yes of course you can train your focus in competition.
The first thing you have to consider is that training your focus "only" in competition will not be enough. To be concentrated in competition you will need to know how to train your focus also at home during training and the more you will train your focus the more it will be easy for you to do it in competition so that it becomes a habit.
To train your focus you can start by imagining that you focus is what your mind concentrates on.
What you focus on becomes your reality so ask yourself "what kind of reality is useful for you before a competition?"
First of all it is important to become aware of your thoughts and become aware of the positive or negative effects that these thoughts can have on your emotions and your beliefs.
Imagine that managing your focus is like riding a young horse, what do you do when the young horse goes in the wrong direction? I imagine that you stop him and you put him in the right direction, the same thing can be done with your mind if you are aware of what is happening so first thin is Awareness.
Second thing is TAKE RESPONSIBILITY of your thoughts, again if you are riding a young horse and he goes in the wrong direction what do you do?? You take responsibility and you stop him right? The same thing can be done with your mind and your thoughts so take responsibility on what you tell yourself.
Third thing is if you are concentrating on things that are not useful for you in competition CHANGE YOUR FOCUS , make yourself other questions or tell yourself things that are useful for you.
These few steps on how to manage your thoughts will help you to calm your mind and put you in an emotional state that is useful for your competition.
This together with visualization and mental anticipation of your competition and other mental coaching techniques will help you to enter in a calm focused bubble.
You can manage your emotional state by working on your physiology and your mental focus.
Your physiology is a combination of these 4 elements of your body:
By managing these 4 together and your mental focus you can manage your emotional state and can therefore easily get into your calm bubble during your competition
Close your eyes and imagine yourself riding a clear test with a calm mind and enter in that feeling...