It depends on whether you consider the bag itself to be a "location"
The Detect Portal feature of the Horizon Walker Ranger sets:
On the 3rd level, you get the ability to magically detect the presence of a flat portal. As an action, it detects the distance and direction to the nearest flat portal. within 1 mile of you …
See the "Flat travel" section in Chapter 2 of the Dungeon Master's Guide for examples of flat portals.
The section on "Planar Trip", specifically the section on "Planar Portals" states:
"Portal" is a general term for An interplanar stationary connection that joins a specific location in one plane to a specific location in another. Some portals function as doors, appearing as a clear window or as a passage covered in fog, and the interplanar journey is as simple as crossing the door. Other portals are locations-ircles of erect stones, high towers, sailboats or even entire villages-that exist on several planes at once or flash from one plane to another. Some are vortices, joining an elementary plane with a very similar location in the material plane, such as the heart of a volcano (which leads to the plane of fire) or the depths of the ocean (to the plane of the water).
The requirements for a flat portal:
1. It must be a "stationary interplanar connection"
2. You must link a Location in a plane to a Location in another plane
A "stationary interplanar connection" would be like a stationary connection between two cell phones. It doesn't mean the phones don't move, it means the connection is stableThis is supported by the fact that locations that change planes or exist on several planes count as portals, especially when it can be a moving sailboat.
We know that a holding bag is an extradimensional space as shown in the question "Is the inside of a holding bag really an extradimensional space?" The portable hole element says:
(…) Placing a portable hole inside An extradimensional space created by a holding bag, Heward's practical backpack, or a similar article …
In addition, extradimensional spaces and demiplanes are the same things in the fifth edition, as shown in the question: "Is the" pocket dimension "a family member enters a demiplane or an extradimensional space?".
Thus, the inside of a holding bag is a demiplane; It is its own plane of existence. We also know that it is a constant / specific plane of existence since the content of the bag is always there. However, the problem is this: does the bag itself count as "a specific location on an airplane"?
What ultimately counts as "a specific location on an airplane" will depend on your GM; however, we have some examples that are mobile: sailboats or villages, if they exist in several planes, or change planes.
A retention bag does nothing more drastic than these places, and the connection is no less "stationary."
That said, a ship and a city are certainly locations, but calling a bag (although magical) a location is not a particularly natural feeling statement.
Yes a holding bag was considered a location, then it would qualify as a flat portal and, therefore, would be detected by the detection portal.
Note that Detect Portal only detects a portal within 1 mile. What 1 mile means when crossing flat boundaries is not defined by the rules, so the way Detect Portal works if a portal is on a different plane of existence would depend on a GM.
Also, as user @Black Spike points out, Detect Portal only finds "the the nearest flat portal less than 1 mile from you, "so you will always find the only one closest to you. If the group carried something like a holding bag, then the Ranger would have to go far to find portals effectively.
The following assumes that Detect Portal will find holding bags and addresses when actually it will:
Thanks to user @Andrew Biggins for finding this question "Does Portal Lore detect currently inactive portals?", The answer there explains that Detecting Portal does not require that the portals be active. Therefore, it will work on portals even when they are no longer active.
A strange scenario is when the bag is placed in another extradimensional space:
Placing a holding bag inside an extra-dimensional space created by a Handy Haversack, Portable Hole or a similar item instantly destroys both items and open a door to the astral plane. The door originates where one element was placed inside the other. Any creature less than 10 feet from the door is absorbed through it to a random location in the astral plane. The door then closes. The door is one way and cannot be reopened.
The door still connects both locations, it is simply a unidirectional connection, so Detect Portal would detect one end of the door, but not the other.