Yes, this is the risk you have to take if you want to trade via an unsafe route. You are allowed (but discouraged) to make such trade. I agree, so it's allowed in my rules. However, unless you are sure the civ entering your territory is looking for a sneak attack, you shouldn't demand it to leave, unless you are playing a defiant game. In any case, it's highly discouraged to do such trade in the first place.