What if all the 8 peers of the node are malicious? I looked at the question on how transactions are broadcast to the rest of the network in the blockchain network. 
In this stack exchange post, the author @morsecoder in the accepted answer mentions that : 


  Think of it like how gossip would spread. There are a bunch of people (nodes), and when one of them knows something, they tell it to the few (8 or so) people they are near (connected with), and then those people tell a few more people the message that was told to them, and then... Eventually everyone knows about the original information (transaction).


But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?

Also, once any given node sends the transaction it received to its peers, how does the network know that majority of peers have received the correct transaction and it's ready to get merged in the main chain. I'm not talking about the bitcoin network here. So, I'm not worried about the PoW for now. I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes?
But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?


Transactions have signatures that sign the whole transaction (except signatures. Signatures are added after the transaction is signed). Signatures prove authenticity so it's impossible to change the transaction without invalidating the signature check.


  I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes? 


There's no count of acceptance. Every node keeps its own mempool which is a list of transactions that could be included in the next block.

PoW is about making blocks. When a block is broadcast, the transaction becomes the part of the immutable blockchain (unless that block is orphaned (replaced by another block.))

If the only nodes you're connected to are malicious, the worst thing they can do to you is to isolate you and log your IP-address and transactions.