One thing to watch out for is with your linked server, are you passing your credentials along OR using a hard-coded username and password?
If it is hard coded, that account will need permissions to run the command on the remote server. Also, if it is hard coded, make 110% sure that hard coded account ONLY has access to things that need to be run. And NEVER EVER EVER have a hard coded sysadmin account on a linked server with RPC enabled.
But to answer your first question - if RPC is disabled on the server, you cannot use RPC to turn it on. You will need to connect to the server directly to turn it on. If your car keys are locked in your trunk, you cannot use those keys to unlock your trunk to get your keys back as you have no access to your keys. BUT if you were in the trunk, you could get your keys. Similar idea here. If you are outside of "server2" you cannot turn RPC on without first connecting to server2.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.