In the Dune film adaptation, Duke Leto Atreides possesses a pug (a dog) that appears in several scenes. At one point, Gurney Halleck, as portrayed by Patrick Stewart carries it into battle. I don't remember reading in the book that Leto had a dog at all, although I could be mistaken. In-universe, why does Leto have a pug that is carried into battle? Out-of-universe, why does he have a dog at all? It seems out of place.
It's worth noting that much of the design work for David Lynch's Dune, the costumes in particular, reference European renaissance designs (as noted on the TV Tropes webpage for this film under the heading space clothes. See here for details...) If renaissance art is taken as one of the big design influences on this film then it is less surprising that there are dogs featured as background detail. Within western art dogs have often been featured as a subject for paintings. The Wikipedia page discussing "cultural depictions of dogs" notes that "Hunting scenes were popular in the Middle Ages and the Renaissance. Dogs were depicted to symbolise guidance, protection, loyalty, fidelity, faithfulness, watchfulness, and love." See here for the whole entry.
In the picture you posted from the film, the character Gurney Halleck shouts "Long live Duke Leto" while carrying a dog. It's hard to interpret this any other way than as a symbol of loyalty. He is in effect one of the Duke's guard dogs. Perhaps the pug is a regimental mascot and he is carrying it rally the troops but we have so little background information on the inclusion of the dogs anything is simply guesswork. You also have to wonder about the sense of carrying a pug into a pitched battle though, I can't see it bringing down many of the enemy.
To reiterate a point made by Sarriesfan in the comments, in the past many nobles did indeed have lap dogs as status symbols, so its logical that the dogs featured in the Atreides houseful and the Emperors court are included for this reason. Unfortunately I have been unable to turn up any comment or anecdote from Lynch or the design team for the inclusion of the dogs so out of universe we can conjecture but cannot say definitively.