Equality legislation in the UK means that it's now illegal for adoption and fostering agencies to refuse to work with you because of your sexual orientation. Similarly, your gender identity should not be used as a reason to accept you as a potential adopter or foster carer.
Because there's an ongoing shortage of both potential adopters and foster carers it's highly unusual for LGBT+ people to share with us stories of discrimination they've experienced when applying to adopt or foster.
Living with HIV, or prior experience of mental health issues don't prevent you from adopting or fostering either. You will need to show that you'll have the energy and health to parent a child, but neither of these instances automatically prevent you from applying to adopt or foster. Similarly there's no upper age limit to either process, just the need to show that you can provide the parenting and care to see your child into adulthood, or for as long as it's anticipated you need to foster them for.
For more information on the requirements to adopt read this summary by First4Adoption.
For more information on the requirements to foster read this information by the Fostering Network.