Hello Kirshan
This is an excellent question and helps to understand the meaning of the subnet mask and how it works.
Whenever a host sends out a packet, it must check to see what the next hop will be . If the destination IP is in the same subnet, the next hop will be the destination host itself. If the destination IP is not in the same subnet, the next hop will be the default gateway. How does a host determine if the destination IP is in the same subnet? By using its own configured subnet mask.
Take your third scenario. PC1 sends a ping to 192.168.2.20. PC1 knows that its own subnet is the range of IP addresses from 192.168.1.0 to 192.168.1.255, and it can determine this from its own IP address and its own subnet mask. So the destination IP is outside its own subnet, so the packet is sent to the default gateway. However, it seems that there is no gateway configured or the gateway is non existant, so the ping fails.
What if PC2 pinged PC1? Well, PC2 knows its own subnet has a range of 192.0.0.0 to 192.255.255.255 based on its IP address and subnet mask. Now the destination IP of 192.168.1.10 is indeed within that range, so the ping would be sent directly to PC1. PC1 would receive the ping, and attempt to respond. But once again, it looks at the destination IP of PC2 and says “this is not in my subnet” and therefore sends the packet to the gateway, and the same failure as before occurs.
So you can see that communication in one direction in this scenario is possible, but not in the other. Even so, since bidirectional communication is not possible, the communication fails.
You can do the same exercise for your second scenario, and you will see that both hosts consider the IP address of the other host in their own subnet, even though the subnet masks do not match, so they send the pings directly to each other.
I hope this has been helpful!
Laz