as long as you and the horse are comfortable and able to deliver your aids properly and in a relaxed way. but personally I wouldn't recommend anything over 17.2-17,3 just because their bodies wear out much faster and often caring for their special big horse needs can be extra expensive.
im 5’10 and ride a 16.2 and also a 14.3, i’d say upper 15 to lower 16 hands is the best fit!
I'm 5'6 and look just fine on a 15hh
I wouldn't look at the size of the horse but the temperament.
However if you're tall I would buy anything under 16 hands so it's comfortable for both and horse is able to meet your needs.
And it also depends on what you like really. I'm 5.6 and I'd love to have a horse that is 16.2-17.2 hands.
Also bigger horse will be safer. I know it might sound weird but reason why is because as you're falling off you do a full turn and if you were falling of a horse that is small you might end up falling on your head which might lead to some serious injuries. It's better on land on our butts or back and get winded than end up on a wheelchair or with brain concussion