I went to my friends house. The dog was nice when i got there. When i left, the dog decided to attack my car and he bit the rear end of the vehicle. Who will be responsible for the damages? My insurance or theirs?
The ultimate legal liability for the damage is probably theirs, although the jurisdiction where this happened would impact the result in principle.
Your car insurance may or may not cover third party damage to your car, depending upon what your insurance policy says, probably with a deductible. But, your car insurance would have a right to subrogation which means a right to sue the person who is legally liable for what the insurance company paid, even if it does cover the law.
The homeowner's or renter's insurance policy of the homeowner with the dog would be responsible for paying damages and hiring a lawyer for the dog owner if the dog owner was sued, but you might have to sue the homeowner to invoke his insurance policy if it refused to pay upon receiving a demand letter.