In the scene where two actors sit in a living room and a dog sits at man’s feet and barks at other actor, they filmed this in a real house that was free of any hazards, so is a safe place for the dog to work. The dog’s trainer brought him to set. The actors were well acquainted with the dog prior to shooting the scene. The trainer cued the dog off-screen to bark. Dog was also quite experienced with film work, so adjusted easily to changes and new behaviors.
In the scene where the actor walks his dog on the beach, prior to shooting the scene the actor greeted dog, reestablished their working friendship with treats. They picked a location that was free of hazards.