I've gone through quite a few references of insect literature including some that can be used to describe what you're seeing and give you reference points on what they could be. The picture you provided looks very similar to a black soldier fly, black larder or carpet beetles. All of these are commonly present around animals and animal feces.
When it comes to larva that may have been ingested, we do not worry about them breeding in a dog's intestinal tract. The settings are not right for this. However, one way to determine quickly if they're ingesting them is to keep both dogs out of the field for a week or so, monitoring all food consumptions, and watching their stool. If you don't see any more, they are most certainly not breeding in the intestinal tract (a minute concern in this case) and most likely being consumed, partially digested and then excreted (this happens more than you think with dogs).
If you are interested in getting the most detailed answer, there are two additional approaches I would take.
1) You can send this larvae sample to an entomology lab in your area which can tell you what you have found. Knowing this, you can work backwards on how it came to be within your pet's stool.
2) You can also present your pet and/or his stool to your vet's office and request a fecal exam be performed. Any ova present in the stool will be identified and a dewormer can be issued, if needed. Again, this looks to be insect larva and the adults would need to be present within the tract to produce the larvae, which is already unlikely as you aren't seeing adults in the stool and, moreover, the conditions would not be right for a live insect to live there and then produce young. A higher chance of an intestinal parasite would be there, but even then you would be seeing adult worms and not larvae. Those intestinal parasitic issues we see don't result in larvae like this. That said, a fecal exam can give you the certainty you're wanting.
If you are interested in finding an entomology lab to send this sample to, tell me know which state you're located in and I'll find one you can get in touch with.
If my answer has helped you, please take the time to leave positive feedback. If questions remain, please reply.