First of all, you need the context and not just Ophelia's words alone, but (1) those her brother, Laertes, that precede them, and (2) the religious context of the time in which the play was written.
(1) Laertes is off to university, and students then, as now, specialise in getting into trouble: money problems, fighting and sex, romantic or otherwise (unlike today, of course). Just read Chaucer's Miller's Tale! Laertes is going to get a long lecture of his own from his dad, Polonius ("...to thine own self be true...").
(2) Educated aristocratic young people of the time would have been deeply steeped in the bible, which is full of fearsome warnings about easy roads to ruin and the more difficult and painful paths of righteousness.
Take Proverbs 5, verse 5. It is to a boy rather than to a girl. It warns about getting involved with a woman, reminding that parts of the bible itself are not free of prejudice about women:
For the lips of a strange woman drop honey, and her mouth is smoother than oil: but her latter end is bitter as wormwood, sharp as a two-edged sword. Her feet go down to death; her feet take hold on Sheol; so that she findeth not the level path of life: her ways are unstable and she knoweth it not...
It goes on to warn against being tempted by her and urges his to listen to his words. But note that he is not being warned against all women: just foreign ones.
Drink waters out of thine own cistern, and running waters out of thine own well.
The Hebrew apostle, Matthew, attrubutes such a warning to Jesus in Chapter 7 of his gospel.
Enter ye in by the narrow gate: for wide is the gate, and broad is the way, that leadeth to destruction, and many be they that enter in thereby. For narrow is the gate, and straightened the way, that leadeth to life."
Laertes is trying to warn Ophelia against being seduced by Hamlet.
Then if he says he loves you,
it fits your wisdom so far to believe it
as he in his particular act and place
may give his saying deed; which is no further
than the main voice of Denmark goes withal...
If with too credent ear you list his songs
Or lose your heart, or your chaste treasure open
To his unmaster'd importunity....
So, all the way back to biblical times, women have been regarded (by men) as dangerous to men. The idea is fixed in the Old and New Testaments, and was a common theme for Sunday sermons "as some ungracious pastors do". She is treating her brother with witty irony. Primroses are chosen, I suspect, because they are a wild and very pretty spring flower, easy thoughtlessly to follow, and to stop and slow down(dally). And the word 'dalliance' did have the amorous connotation of Ophelia's remarks here.
Sex has already been raised by her brother's warning her not to "open your treasure". So it is in the air. However, the word 'dalliance' itself is broader than that. It is true that some online dictionaries (such as the Cambridge online English, appear to give great weight the the sexual aspect of the word. But if you look at a fuller dictionary, you get a broader picture of what it might have meant to people in Shakespeare's own day. The full Oxford English Dictionary starts with
1 conversation, converse, chat (of a familial kind)
2 Sport, play .... (and goes on to add) esp of an amorous toying or caressing. Flirtation; often, in a bad sense, wanton toying
3 Idle or frivolous action
4 Waste of time or trifling
The citations in the century or so around Shakespeare seem to range between flirtation and sex, and that is surely what is in the air here. But, as so often, the attribution of hedonism to the primrose to hedonism seems to be yet another Shakespeare contribution to English discourse.