The output of the ejector pit is to the sanitary sewer line and you can only discharge sewage and "gray" water into this line in most jurisdictions. Many times builders include a grinder in the ejector pit in case a basement bathroom is later installed and because local building codes require it. It would not surprise me if you find other plumbing stubs for at least a toilet and a sink nearby.
The sump pit should drain to the storm sewer line and this should ONLY include rainwater or ground water as this will drain to without being processed by the sewage treatment facility. In other words, it should only have "clean" water that doesn't need sanitary processing.
No, you cannot use these interchangeably. The washer not only discharges "grey" water but also solids from the clothing that will likely clog a regular sump pump over time eventually leading to flooding.