Yes. Of course different subnets can communicate with each other. You just need at least one piece of hardware which is connected to both networks and which knows how to route
traffic between them.
Usually this is done with a router, but if you do not have one available you could use a multihomed PC.
It might be useful to read up on this post on Server Fault Q&A to learn how IPv4 subnetting works. (especially the part "You can't get there from here").
However you already tagged your post router, so you probably are aware that such a device exists. Which confused me since the question "Could both LANs communicate to each other?" and the answer (in the tag) are already next to each other. What was it precisely that you wanted to ask?