Paint brush type is generally a preference, rather than a right or wrong choice. Foam brushes are very common and usually have predictable application properties, so it really comes down to whether you like the feel and finish a foam brush provides.
Compatibility with the primer should dictate the material that the brush is made of. With bristle brushes, the bristles can be made from natural, nylon, poly, or other hair types. Foam brushes are usually of poly construction, and are commonly safe for most one-part paints, primers, and varnishes. However, some two-part urethane or epoxy systems can contain solvents or chemicals that will destroy a foam brush.
Another important thing to note is that not all foam brushes are created equally, and many are not constructed in the same way, or from the same material. Some are simply cut foam, and some are glued to hold their shape. Jen brand foam brushes indicate that they are not to be used with lacquer or shellac, but are safe with enamels, latex paints, oil-based paints, stains, and varnishes.
If it's ever a concern, we recommend that you contact the manufacturer of the paint, primer, or varnish to determine if a foam brush can be used, because a foam brush may not work with certain brands.