#1 rewrites url without www to an url with www
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]
This rule should be LAST of all your external redirects. The condition is best expressed as
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
meaning "anything other than the exact form I prefer". The sole purpose of this rule is to pick up requests that have not already been redirected in the course of other rules; that's why it always comes last.
Incidentally, you don't need anchors in the pattern. They will do no harm, they just aren't needed.
#2 rewrites a query to a path and gives a 301 redirect
RewriteCond %{QUERY_STRING} page1
RewriteRule .? page1 [QSD,R=301,L]
Eeuw. Are you in Apache 2.4? The new flag QSD will work, but there's honestly no reason not to stick with putting a ? at the end of the target for a net savings of three bytes. The target also needs a full protocol-plus-hostname. And, finally, the pattern should be constrained to only those URLs where this query string can actually occur. If that's the root, the rule will look like
RewriteCond %{QUERY_STRING} page1
RewriteCond %{THE_REQUEST} \?
RewriteRule ^(index\.php)?$ http://www.example.com/page1? [R=301,L]
The second condition is essential to prevent infinite loops: It says "only execute this rule if the user
asked for the form with query string". I added the (index\.php)? in case some annoying search engine makes a request in this form. May as well redirect them with the same rule.
#3 redirects path to query and prevents a loop by the END flag, L is definitely not working.
RewriteRule ^(page1)$ \?$1 [END]
Wtf?
:: detour to docs ::
Oh, I see. I suppose it must be needed for someone, somewhere, but here all you need is [L].
The infinite loop is not caused by this rule; it's caused by the lack of a %{THE_REQUEST} condition in the previous rule. The rewrite will look like this:
RewriteRule ^(page1)$ /index.php?$1 [L]
I assume the point of the capture and reuse is that on your real site there will be lots of options, like (page1|page2|morestuff|etcetera). Otherwise of course you'd just use literal text in the target, with no capture.
Again, the order of these three rules should be #2 #1 #3.