Among dual enrollment courses, some colleges do favor those taken at the college (or disfavor those taken as “college in the high school”).
In terms of rigor comparison, compare what the courses actually are. Dual enrollment courses may cover material that is lower level, similar level, or higher level compared to AP courses. Where the same or same level material is covered, that is where the choice may be significant.
In-state public universities in some states may have extensive articulation agreements with community colleges, but many out-of-state and private universities may not. If there is an articulation agreement, you can see which of the dual enrollment or AP score is seen as better for courses covering the same material. If there is no articulation agreement, you may have to guess based on what the university gives for the AP score.