Should I use "like" or "as if" before a statement containing a preposition?

Solution 1:

Both the variants described can be seen as deleted forms:

John and Jane went together like peas in a pod.

John and Jane went together like peas in a pod go together.

...........

John and Jane went together as if peas in a pod.

John and Jane went together as if they were peas in a pod.

There's little to choose between these (original) paraphrases, other than that the one using 'like' is more common and hence sounds more natural.