Does your landlord know there is a girl living there with a dog who doesn't pay rent? If they find out they can fine *you* big time or possibly evict you. A permanent house guest is usually frowned upon and can show up in your lease as a No-No. Unlicenced pets not owned under contract in the lease agreement can also lead to eviction, no refund of your security deposits (for any damage the dog may or may not have caused), and serious fines.
As for the dog, sadly it's not your responsibility to train the dog. Your friend needs to be proactive and she needs to stop giving the dog positive reinforcement when it barks. Have you tried tiring the dog out? Get people to knock and come in and out constantly for a few hours without stopping, the dog may learn that people are no big deal.
Seriously though, if she's not on your lease she and her dog shouldn't be there You and your roommates who are can get in serious trouble for it because ultimately you are responsible for your apartment. She's just a "house guest."