"Can the agent who is representing the seller also represent the buyer?"
Dual Agency in Maryland is interpreted differently than it is in other states. Here, only the broker (or the broker's designee) can take on the role of a dual agent. An individual Realtor® cannot represent both, seller and buyer, and can never act as a dual agent. Maryland is an either/or state.
When you walk into an open house, the agent present always represents the seller. While the listing agent can open the door for you and answer a few questions, his/her loyalty lies with the seller and it is his/her duty to act in the seller's best interest.
Thus, if you choose to have the seller's agent "assist" you with a purchase offer, understand that this assistance is very limited. The seller's agent cannot advise you on what price range your offer should fall in nor on any other terms of the contract, e.g. which contingencies to include.
Considering that you are about to make one of the biggest decisions of your life, having your own representation is in your best interest.
If you choose to hire an agent from the same company as the listing agent, then those agents are referred to as intra-company agents. They are assigned by the broker of the company who acts as the dual agent in this scenario. A Consent For Dual Agency has to be signed by both, the seller and the buyer. If one party refuses then the listing broker can opt to cancel the agreement with the seller in order to represent the buyer, the buyer can choose to receive assistance but no representation or the buyer can hire a Realtor® affiliated with a different company.
Whether you hire your own buyer's agent, have the listing agent "assist" you or consent to Dual Agency, Realtors® are required to treat all parties fairly and keep confidential information just that, confidential.
The agent who is representing the seller cannot also represent the buyer. That form of dual agency is prohibited in the State of Maryland. Only the broker or broker's designee (e.g branch manager) can act as a dual agent and assign intra-company agents. A Consent for Dual Agency has to be signed by both, seller and buyer.
*I am not a lawyer. Legal advice is neither given nor implied. If you are in need of such, contact legal counsel.*