“Context” can be a countable as well as an uncountable noun. When you speak about context in general, the word is usually uncountable, e.g.
His words were taken out of context.
However, when you speak about several different types of context, it is used as a countable noun. In particular, this is the case when you contrast formal and informal contexts, e.g.
Phrases “in formal context” and “in informal context” are not wrong per se and can be sometimes found in English literature, but the corresponding phrases with indefinite articles are much more common and therefore preferable.