The <If> container changes the order of processing. <If> containers are merged very late. See: how sections are merged in the Apache docs
This results in the RewriteRule directives inside the <If> matching against the absolute filesystem path that the request has mapped to, including the directory-prefix, which is ordinarily removed when matching in a directory context (ie. .htaccess). (Maybe the request has been mapped back to the filesystem at the time the <If> section is processed?)
RewriteRule ^fr/cookie-policy/$ /index.php?pageid=11 [L]
So, if fr/cookie-policy/ is relative to the document root and the DocumentRoot is /var/www/user/public_html then to match this exactly, you need to match against /var/www/user/public_html/fr/cookie-policy/.
I don't see any way to avoid this unless you use an additional condition (and check against the REQUEST_URI server variable) - but that would seem to defeat the point (and would be less efficient).
it will matches anything the ends with a designated pattern.
Without specifying the full absolute file-path, you could perhaps just include the parent directory (ie. one above the document root) to lessen the chances of this happening. eg. public_html/fr/cookie-policy/$.
A few other (bizarre) caveats I've noticed with using mod_rewrite inside an <If> section:
You can't rewrite to a relative path (ie. not starting with a slash or scheme+hostname). It needs to start with a slash (ie. root-relative). Rewriting to a relative path in a directory context ordinarily results in the directory-prefix being added back. However, inside the <If> container, the directory-prefix appears to be seen as *If/ - which will likely result in a "400 Bad Request". (Maybe this is because at the time the <If> section is merged, the directory-prefix has already been added back?)
Related to above, the RewriteBase directive is "ignored".
Other mod_rewrite directives outside of the <If> section (in the same context at least) appear to take on the same behaviour and now also only match against the full absolute filesystem path.
Despite <If> sections being merged "late". They are still processed before other mod-rewrite directives outside of the <If> section. Regardless of the order of the directives. (In the same context at least.)
See also: <If> condition with HTTP_HOST in htaccess breaks PHP
Ordinarily, if you need to check the HTTP_HOST before applying a particular rewrite then you'd check this in a preceding RewriteCond (condition). But you know that already