They can't stop you doing that, and I've been to races years ago where people were on their mobile bellowing out a horse number to their mate on the other end, who is sitting ready to place a bet on the supposed winner. But that's not a very fine-grained way to bet, it relies on the person on the track getting things exactly right and having the correct viewing position at the critical moment.
However, people courtsiding in tennis matches have been kicked out - and in some places, they've tried arresting them: https://www.bbc.co.uk/news/magazine-32402945