Does a brokerage firm have its own price matching engine? or it is only that exchanges can do this all matching stuff? Is the location of price matching for a trade can optionally decided ? i.e. Does a brokerage firm have its own price matching engine which gets the Market depth updates and runs price matching algorithms against that data for its customers? or it is only that exchanges can do this all matching stuff?

Which is the generally followed method in practice?
In a financial world, no broker offers his own matching engine to execute the orders of his client with another trader, all trades have to go through echanges (except FOREX market). They typically contract the exchange or another data feed vendor. By doing this they transfer the risk to the data vendor that if anything happens with the data feed, they are not in charge.