Hello Levente,
This is a good question!
It seems that the 'template matching' algorithm supports only the 'pixel level' domain. With this limitation and your wish to restrict the algorithm on a area of interest (normally defined by an image object domain or region - what you tried already), we have to limit the 'pixel level' domain via a special 'map'. Please generate (based on your region variable) a new map (using 'copy map') algorithm and execute the 'template matching' process on the new map (defined via the domain of the process). Sound complicated, but it is easy. :-)
By the way, you can transfer the output layer between maps via 'transfer layer' algorithm.
Hope that helps,
If not, and please use the eCognition Community for such questions! (myself and my colleagues and other eCognition users helping each others here. You can find also demonstration projects (see Library in the Knowleadge base) and much more. Please be active here: eCognition | Knowledge Base
See you at the eCognition Community,
Christian