Write a function to generate a specific sequence based on input constraints.
Implement generate_sequence(n, primes) to return the first n positive integers whose prime factors all belong to primes; include 1 as the first term and return the sequence in strictly increasing order. The function signature is generate_sequence(n, primes), with 1 <= n <= 1000 and 2 <= prime <= 50.
def generate_sequence(n, primes):