If the scenario may occur or not depends on your topology.
Actually, stream tasks are assigned to stream threads, not plain partitions. Each task may process a group of partitions. One group contains one or more partitions. If the group contains multiple partitions, it always contains the same partitions (i.e., the ones with the same partition number) of different topics. For example, a group may contain xyz1-partition 0, xyz2-partition 0 but not xyz1-partition 0, xyz2-partition 2. This assumes that the different topics use the same partition strategy. Such a co-partitioning of the same partitions of different topics is needed -- for example -- in the case of a join where records with the same key must be processed by the same stream task, similarly as in your second scenario.
If you assume that in your first example each partition is processed by a different stream task, i.e., each partition group contains one partition, the scenario may occur.
If you assume that both partitions on each line are processed by the same stream task (i.e. both partitions are part of the same partition group), the scenario cannot occur, because partition groups cannot contain different partitions.
For more information on the assignment strategy see https://github.com/apache/kafka/blob/e4262471c9aee4a4c04dd04ebbdbdba7e3c5ead1/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java#L297
Said that, actually there is a way to assign different partitions to the same task by implementing the PartitionGrouper interface. However, this interface will be deprecated in the 2.4 and removed in 3.0. See https://cwiki.apache.org/confluence/display/KAFKA/KIP-528%3A+Deprecate+PartitionGrouper+configuration+and+interface .