Servers are not interoperable by default. There is 3rd party software that acts as a proxy letting Bedrock players connect to Java servers but it'll just remove anything that the more limited client doesn't support.
They both use completely different network stacks, Bedrock using RakNet over UDP, Java using Netty (?) over TCP, so they have to be translated accordingly.