Usually, a chromatic alteration of a note follows the other version of that note in the same part. Such a chromatic step is also called a passus duriusculus.
However, when a chromatic alteration of a note follows the other version of that note in another part, this is usually considered to be erroneous, an error called a false relation or a cross-relation.
Yet composers are not always bothered by this rule, as the following example illustrates:
And cross-relations “that result from the simultaneous use of the ascending and descending forms of the melodic minor scale are common in this [i.e. the Baroque] style and are generally acceptable” (Kennan (1999), p. 56):
Select Bibliography
Kennan, Kent. Counterpoint Based on Eighteenth-Century Practice — Fourth Edition (New Jersey: Prentice-Hall, 1999).