Please tell me if it is possible that the site is written using java, and the logic is written in C, for example. If so, why and how will this link be made?
You can, there are many options, from calling native methods to RMI.
If and when it makes sense at all?
This can make sense in two cases: when you need to make some complicated calculations using CUDA, OpenCL, etc., or when the performance of C code is much faster. But in the second case it is more logical to optimize Java code.
In most web and interpipe tasks, such bicycles are unnecessary.