Medicaid was created on July 30, 1965, through Title XIX of the Social Security Act. Medicare was first created by President Truman in 1945 but it was not officially signed into law until 1965 by President Johnson.
If by "pay Medicare" you mean the Medicare payroll tax, the only way to avoid this is to work at a job that is not covered by Medicare. There aren't very many of these. If you're referring to Medicare premiums, the law does not require anyone to enroll in Medicare.