The Israelites and Jews had slaves throughout the biblical period, as various passages of the Bible attest. Exodus 12:44 talks of the purchase of slaves and the need for them to be circumcised, which implies that these were non-Hebrew slaves. As the question implies, it seems anachronistic that the fleeing slaves would have had slaves at the start of the Exodus or even at any time during the forty years of wandering, but Exodus 12:44-45 does not necessarily mean that the fleeing Israelites actually had slaves at this stage -- it can be read as a teaching or instruction for when the Israelites would soon have slaves.
More importantly, it is anachronistic that they could even bear to think of enslaving another human as they had so recently been enslaved. God would need to have been incredibly insensitive to bring the subject up at this early stage in the Exodus. However, modern scholarship states that this was not written during the putative Exodus nor for the people of the Exodus: it was written as instructions for the Jews of much later times. According to the Documentary Hypothesis, the Book of Exodus was written by at least three authors at various times during much of the first millennium BCE. If these laws were seen as having the imprimatur of Moses, who received them from God during the Exodus from Egypt, then they must be obeyed by all future generations.