I will first give some general remarks about Hamilton's stationary action, and then I will write specifically about the case you are asking about: a force that is a function of velocity.
The criterium of stationary action expresses the following demand: as an object is moving along some trajectory the rate of change of kinetic energy must match the rate of change of potential energy continuously. (As opposed so any kind of averaging.)
Here is how that 'continuously' comes into play:
Let's say you have obtained a trajectory from coordinates $(q_1, t_1)$ to $(q_3, t_3)$.
You can subdivide that trajectory in multiple subsections, for simplicity I will divide in two concatenated subsections: from $(q_1, t_1)$ to $(q_2, t_2)$ and from $(q_2, t_2)$ to $(q_3, t_3)$
If the action is stationary for the trajectory from $(q_1, t_1)$ to $(q_3, t_3)$, then if you evaluate the sections $(q_1, t_1)$ to $(q_2, t_2)$ and $(q_2, t_2)$ to $(q_3, t_3)$ individually: for each the action will be stationary.
In order for the action to be stationary from $(q_1, t_1)$ to $(q_3, t_3)$ the action must be stationary for each of the subsections. The subdivision reasoning goes down all the way to the limit of infinitisimally short subsections, concatenated. (This property was first pointed out by Jacob Bernoulli, older brother of Johann Bernoulli, in the course of solving the brachistochrone problem.)
So we have that the criterium of stationary action expresses the demand that as an object moves: from instant to instant, down to infinitisimal, the rate of change of kinetic energy must match the rate of change of potential energy.
To express motion taking place in terms of conversion of energy a necessary requirement is that the potential energy is well defined.
A necessary condition for the potential energy to be well defined is that as an object moves from a spatial coordinate $q_1$ to a spatial coordinate $q_2$ the difference in potential energy must be independent of how the object moves from position $q_1$ to position $q_2$. Mathamatically: any path integral from $q_1$ to $q_2$ should arrive at the same value for the net amount of work done.
As mentioned in the answer by Qmechanic: a necessary condition for that is that the constraints are holonomic.
A force that is a function of velocity
Another condition relates to what you are asking about: what if there is also a force present that is a function of velocity?
As we know, an example of a force-that-is-a-function-of-velocity is friction. If you don't have a way of accounting for the energy conversion due to friction then there is no direct way to use energy description to obtain an equation of motion.
There is a force such that while it introduces a velocity dependent contribution it is still possible to arrive at a well defined potential energy. That force is the Lorentz force.
The effect of the Lorentz force occurs at right angles to the velocity vector. As we know: the Lorentz force vector turns with the velocity vector, always acting perpendicular. As we know: a force that acts perpendicular to the velocity vector does not change the magnitude of the velocity, hence it does not change the kinetic energy.
Returning to Hamilton's stationary action:
In the general case:
If there is a force contribution that is a function of velocity (and not at right angles to the velocity vector), then there is no well defined potential energy, and then the physics taking place is for Hamilton's stationary action out of scope.
That is: Hamilton's stationary action has a domain of applicability and if the potential energy is not well defined then the physics taking place is not in the domain of applicability of Hamilton's stationary action.
As pointed out by physics.SE contributor knzhou: in physics you can often run derivations in both directions
There is a way to proceed from $F=ma$ to Hamilton's stationary action.
It's a two stage process; the intermediate stage is the work-energy theorem.
A corollary of the work-energy theorem is that as an object is moving along some trajectory the rate of change of kinetic energy will match the rate of change of potential energy.
That is: in order to go from F=ma to Hamilton's stationary action the work-energy theorem is sufficient; using d'Alembert's principle is not a necessity.