People who aren't HIV-infected can develop OIs if their immune systems are damaged. For example, many drugs used to treat cancer suppress the immune system. Some people who get cancer treatments can develop OIs.
HIV weakens the immune system so that opportunistic infections can develop. If you are HIV-infected and develop opportunistic infections, you might have AIDS.